70sOn7

Event

Nov 22nd, 2017
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.47 KB | None | 0 0
  1. command /event <text>:
  2. trigger:
  3. if arg-1 is not set:
  4. if player doesn't have permission "essentials.event":
  5. send "&c/event join"
  6. else:
  7. send "&9&l[Event]"
  8. send " "
  9. send "&9/event join (Joins Event)"
  10. send "&9/event start (Starts Event)"
  11. send "&9/event stop (Stops An Event)"
  12. send "&9/event settp (Sets The TP)"
  13. send "&9/event tp (TPs To Event TP)"
  14. if arg-1 is "help":
  15. if player doesn't have permission "essentials.event":
  16. send "&c/event join"
  17. else:
  18. send "&9&l[Event]"
  19. send " "
  20. send "&9/event join (Joins Event)"
  21. send "&9/event start (Starts Event)"
  22. send "&9/event stop (Stops An Event)"
  23. send "&9/event settp (Sets The TP)"
  24. send "&9/event tp (TPs To Event TP)"
  25. if arg-1 is "join":
  26. if {event.join} is not set:
  27. send "&cAn event has not started or is in progress!"
  28. if {event.join} is true:
  29. send "&9&l[Event] &9Teleporting in 2 seconds!"
  30. wait 1 second
  31. send "&9&l[Event] &9Teleporting in 1 second!"
  32. wait 1 second
  33. teleport player at {event.start}
  34. set {event.%player%.start} to true
  35. send "&9&l[Event] &9Wait here till the event starts!"
  36. set {event} to true
  37. if arg-1 is "settp":
  38. send "&9&l[Event] &9You have set the TP for the event!"
  39. set {event.start} to player's location
  40. if arg-1 is "tp":
  41. if {event.start} is set:
  42. send "&9&ll[Event] &9You have TP-ed to the event TP!"
  43. teleport player at {event.start}
  44. if {event.start} is not set:
  45. send "&9&[Event] &9You need to set the TP for the event first!"
  46. if arg-1 is "start":
  47. if player doesn't have permission "essentials.event":
  48. send "&cYou cannot do this!"
  49. stop
  50. if player has permission "essentials.event":
  51. if {event.start} is set:
  52. broadcast " "
  53. broadcast "&9&l[Event] &9Event started! Do '/event join' to join in!"
  54. broadcast " "
  55. teleport player at {event.start}
  56. set {event} to true
  57. wait 20 seconds
  58. broadcast "&9&l[Event] &9Starting in 10 seconds!"
  59. wait 7 seconds
  60. broadcast "&9&l[Event] &9Starting in 3 seconds!"
  61. wait 1 second
  62. broadcast "&9&l[Event] &9Starting in 2 seconds!"
  63. wait 1 second
  64. broadcast "&9&l[Event] &9Starting in 1 second"
  65. wait 1 second
  66. broadcast "&9&l[Event] &9The event has started!"
  67. loop all players:
  68. if {event.%loop-player%.start} is true:
  69. set {event.%loop-player%} to true
  70. delete {event.%loop-player%.start}
  71. else:
  72. send "&9&l[Event] &9You need to set the TP for the event!"
  73. send "&9&l[Event] &9Use /event settp to set the TP!"
  74. stop
  75. if arg-1 is "stop":
  76. if player doesn't have permission "essentials.event":
  77. send "&cYou cannot do this!"
  78. stop
  79. if player has permission "essentials.event":
  80. if {event} is true:
  81. loop 2 times:
  82. broadcast " "
  83. broadcast "&9&l[Event] &9Event has been stopped!"
  84. loop 2 times:
  85. broadcast " "
  86. loop all players:
  87. if {event.%loop-player%} is true:
  88. make player execute "/spawn"
  89. delete {event.%loop-player%}
  90. delete {event}
  91. stop
  92. if {event} is not set:
  93. send "&cAn event has not started!"
  94. stop
  95.  
  96. on quit:
  97. if {event.%player%} is true:
  98. delete {event.%player%}
  99. send "&9&l[Event] &9You have left the event!"
  100. if {event.%player%.start} is true:
  101. delete {event.%player%.start}
  102. send "&9&l[Event] &9You have left the event!"
  103.  
  104. on any movement:
  105. if {event.%player%.start} is true:
  106. cancel event
Add Comment
Please, Sign In to add comment