Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command /koth [<text>]:
- trigger:
- if arg is set:
- if player has permission "*":
- if arg is "start":
- if {koth.started} is not set:
- set {koth.started} to true
- broadcast ""
- broadcast "&2&lKOTH &8| &aA KOTH is now starting at &7&n/KOTH&a!"
- broadcast ""
- if arg is "end":
- broadcast ""
- broadcast "&2&lKOTH &8| &aThe KOTH has ended. &7&n%{koth.capping}%&a was the final capping player."
- broadcast ""
- delete {koth.started}
- delete {koth.capping}
- delete {koth.capping.times.second.::*}
- delete {koth.capping.times.minutes.::*}
- delete {koth.items.given}
- if arg is "settp":
- set {koth.tp} to location of player
- send "&2&lKOTH &8| &7KOTH tp has been set!"
- if arg is "edit":
- open chest inventory with 6 rows named "&2&lKOTH &8| &aEdit" to player
- loop integers from 0 to 53:
- set slot loop-value - 1 of player's current inventory to {koth.items::%loop-value - 1%}
- if arg is "help":
- send ""
- send "&2- &a/koth start &7- Start a koth"
- send ""
- send "&2- &a/koth end &- End a koth"
- send ""
- send "&2- &a/koth settp &7- Set the teleportation point for /koth"
- send ""
- send "&2- &a/koth edit &7- Edit rewards"
- send ""
- if arg is not "help" or "start" or "end" or "edit" or "settp":
- make player execute command "/koth help"
- else:
- make player execute command "/koth"
- else:
- if {koth.started} is set:
- send "&2&lKOTH &8| &7Teleporting in &a&n6&7 seconds... Don't move!"
- set {_loc} to location of player
- wait 6 seconds
- if {_loc} is location of player:
- teleport player to {koth.tp}
- send "&2&lKOTH &8| &aWelcome to the koth."
- else:
- send "&2&lKOTH &8| &cTeleportation stopped, you moved!"
- on inventory close:
- if name of player's current inventory is "&2&lKOTH &8| &aEdit":
- loop integers from 0 to 53:
- set {koth.items::%loop-value - 1%} to slot loop-value - 1 of player's current inventory
- send "&2&lKOTH &8| &aRewards modified."
- every 1 second:
- if {koth.started} is set:
- loop all players:
- if "%region at loop-player%" contains "koth_platform":
- if {koth.capping} is loop-player:
- add 1 to {koth.capping.times.second.::%loop-player%}
- if {koth.capping.times.second.::%loop-player%} >= 60:
- add 1 to {koth.capping.times.minutes.::%loop-player%}
- set {koth.capping.times.second.::%loop-player%} to 0
- add a random element of {koth.items::*} to loop-player's inventory
- send "&2&lKOTH &8| &a%loop-player% &7has received an item!" to all players within 30 blocks of loop-player
- add 1 to {koth.items.given}
- if {koth.items.given} >= 5:
- execute console command "/koth end"
- on region enter:
- if "%region at player%" contains "koth_platform":
- if {koth.started} is set:
- if {koth.capping} is not set:
- set {koth.capping} to player
- send "&2&lKOTH &8| &a%player%&7 is now capping the KOTH!" to all players within 30 blocks of loop-player
- exeucte console command "/hd setline koth 9 &7Capped By: &2%player%"
- on region leave:
- if "%region at player%" contains "koth_platform":
- if {koth.started} is set:
- if {koth.capping} is player:
- delete {koth.capping}
- send "&2&lKOTH &8| &a%player%&7 is no longer capping the KOTH!" to all players within 30 blocks of loop-player
- exeucte console command "/hd setline koth 9 &7Capped By: &2N/A"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement