Advertisement
Guest User

Untitled

a guest
Apr 18th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.43 KB | None | 0 0
  1. command /koth [<text>]:
  2. trigger:
  3. if arg is set:
  4. if player has permission "*":
  5. if arg is "start":
  6. if {koth.started} is not set:
  7. set {koth.started} to true
  8. broadcast ""
  9. broadcast "&2&lKOTH &8| &aA KOTH is now starting at &7&n/KOTH&a!"
  10. broadcast ""
  11. if arg is "end":
  12. broadcast ""
  13. broadcast "&2&lKOTH &8| &aThe KOTH has ended. &7&n%{koth.capping}%&a was the final capping player."
  14. broadcast ""
  15. delete {koth.started}
  16. delete {koth.capping}
  17. delete {koth.capping.times.second.::*}
  18. delete {koth.capping.times.minutes.::*}
  19. delete {koth.items.given}
  20. if arg is "settp":
  21. set {koth.tp} to location of player
  22. send "&2&lKOTH &8| &7KOTH tp has been set!"
  23. if arg is "edit":
  24. open chest inventory with 6 rows named "&2&lKOTH &8| &aEdit" to player
  25. loop integers from 0 to 53:
  26. set slot loop-value - 1 of player's current inventory to {koth.items::%loop-value - 1%}
  27. if arg is "help":
  28. send ""
  29. send "&2- &a/koth start &7- Start a koth"
  30. send ""
  31. send "&2- &a/koth end &- End a koth"
  32. send ""
  33. send "&2- &a/koth settp &7- Set the teleportation point for /koth"
  34. send ""
  35. send "&2- &a/koth edit &7- Edit rewards"
  36. send ""
  37. if arg is not "help" or "start" or "end" or "edit" or "settp":
  38. make player execute command "/koth help"
  39. else:
  40. make player execute command "/koth"
  41. else:
  42. if {koth.started} is set:
  43. send "&2&lKOTH &8| &7Teleporting in &a&n6&7 seconds... Don't move!"
  44. set {_loc} to location of player
  45. wait 6 seconds
  46. if {_loc} is location of player:
  47. teleport player to {koth.tp}
  48. send "&2&lKOTH &8| &aWelcome to the koth."
  49. else:
  50. send "&2&lKOTH &8| &cTeleportation stopped, you moved!"
  51.  
  52. on inventory close:
  53. if name of player's current inventory is "&2&lKOTH &8| &aEdit":
  54. loop integers from 0 to 53:
  55. set {koth.items::%loop-value - 1%} to slot loop-value - 1 of player's current inventory
  56. send "&2&lKOTH &8| &aRewards modified."
  57.  
  58.  
  59.  
  60.  
  61.  
  62. every 1 second:
  63. if {koth.started} is set:
  64. loop all players:
  65. if "%region at loop-player%" contains "koth_platform":
  66. if {koth.capping} is loop-player:
  67. add 1 to {koth.capping.times.second.::%loop-player%}
  68. if {koth.capping.times.second.::%loop-player%} >= 60:
  69. add 1 to {koth.capping.times.minutes.::%loop-player%}
  70. set {koth.capping.times.second.::%loop-player%} to 0
  71. add a random element of {koth.items::*} to loop-player's inventory
  72. send "&2&lKOTH &8| &a%loop-player% &7has received an item!" to all players within 30 blocks of loop-player
  73. add 1 to {koth.items.given}
  74. if {koth.items.given} >= 5:
  75. execute console command "/koth end"
  76. on region enter:
  77. if "%region at player%" contains "koth_platform":
  78. if {koth.started} is set:
  79. if {koth.capping} is not set:
  80. set {koth.capping} to player
  81. send "&2&lKOTH &8| &a%player%&7 is now capping the KOTH!" to all players within 30 blocks of loop-player
  82. exeucte console command "/hd setline koth 9 &7Capped By: &2%player%"
  83. on region leave:
  84. if "%region at player%" contains "koth_platform":
  85. if {koth.started} is set:
  86. if {koth.capping} is player:
  87. delete {koth.capping}
  88. send "&2&lKOTH &8| &a%player%&7 is no longer capping the KOTH!" to all players within 30 blocks of loop-player
  89. exeucte console command "/hd setline koth 9 &7Capped By: &2N/A"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement