Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.07 KB | None | 0 0
  1. on quit:
  2. if {queue::*} contains {_p}:
  3. queue(player)
  4. if {ingame::*} contains {_p}:
  5. elim(player, "&7thought the map was too spooky.")
  6.  
  7. function queue(p: offlineplayer):
  8. if {queue::*} contains {_p}:
  9. remove {_p} from {queue::*}
  10. if {start} is set:
  11. if size of {queue::*} = 3:
  12. delete {start}
  13. send formatted "&7Start cancelled." to all players
  14. else:
  15. add {_p} to {queue::*}
  16. if size of {queue::*} = 4:
  17. if {noManualStart} is set:
  18. start()
  19.  
  20. command /start [<text>]:
  21. permission: op
  22. permission message: &cno
  23. trigger:
  24. if {noManualStart} is not set:
  25. if {start} is not set:
  26. start()
  27. else:
  28. send "&6&lMHDrop &7The game already started."
  29. else:
  30. send "&6&lMHDrop &7Manual start isn't on."
  31.  
  32.  
  33. function start():
  34. set {start} to true
  35. teleportCountdown()
  36. startCountdown()
  37.  
  38. function teleportCountdown():
  39. loop 30 times:
  40. if {start} is set:
  41. if 30 - (loop-number - 1) = 30, 10, 5, 3, 2 or 1
  42. send formated "&6&lMHWool &7Teleporting in &e%30 - (loop-number - 1)% &7seconds." to all players
  43. wait 1 second
  44. else:
  45. stop loop
  46.  
  47. function startCountdown():
  48. loop 10 times:
  49. if {start} is set:
  50. if 10 - (loop-number - 1) = 10, 5, 3, 2 or 1
  51. send formated "&6&lMHWool &7Starting in &e%10 - (loop-number - 1)% &7seconds." to all players
  52. wait 1 second
  53. else:
  54. stop loop
  55. if {start} is set:
  56. delete {start}
  57. set {started} to true
  58. send formatted "&6&lMHWool &7The game has started!" to all players
  59. set {ingame::*} to {queue::*}
  60. resetLoot()
  61.  
  62. function resetLoot():
  63. set {_var::*} to {chestLoc::*} where [setLoot(input) = true]
  64.  
  65. function setLoot(l: location) :: boolean:
  66. set block at {_l} to chest
  67. loop (random integer between 3 and 10 times):
  68. set slot (random integer between 0 and 26) of inventory of block at {_l} to random element out of {lootTable::*}
  69.  
  70.  
  71. command /queue [<text>]:
  72. aliases: q
  73. cooldown: 2 seconds
  74. cooldown message: &cThis command is on cooldown! %remaining time%
  75. trigger:
  76. if arg-1 is not "join", "auto" or "leave":
  77. send "&8&m----------"
  78. send "&a/queue join"
  79. send "&a/queue auto"
  80. send "&a/queue leave"
  81. send "&8&m----------"
  82. cancel cooldown
  83. else:
  84. if arg-1 is "join" or "leave":
  85. if arg-1 is "join":
  86. if {queue::*} doesn't contain player:
  87. queue(player)
  88. else:
  89. send "&cYou're already in the queue!"
  90. cancel cooldown
  91. else:
  92. if {queue::*} contains player:
  93. queue(player)
  94. else:
  95. send "&cYou're not in the queue!"
  96. cancel cooldown
  97. else:
  98. if {autoqueue::%player%} is not set:
  99. set {autoqueue::%player%} to true
  100. send "&aEnabled Auto Queue!"
  101. else:
  102. delete {autoqueue::%player%}
  103. send "&cDisabled Auto Queue!"
  104. cancel cooldown
  105.  
  106. function endGame(winner: offlineplayer):
  107. send formatted "", "&6&lMHWool &e%{_winner}% &7has won the match!" and "" to all players
  108. set {wins::%{_winner}%} to ({wins::%{_winner}%} ? 0) + 1
  109. console command "/resetGame"
  110.  
  111. function elim(p: offlineplayer, t: text="&7was eliminated!"):
  112. if {ingame::*} contains {_p}:
  113. remove {_p} from {ingame::*}
  114. send title "&c&lYou Died!" with subtitle "&7Better luck next time!" to {_p}
  115. send "&6&lMHDrop &e%{_p}% &7%{_t}%"
  116. if size of {ingame::*} is 1:
  117. set {_winner} to first element out of {ingame::*}
  118. endGame({_winner})
  119.  
  120. on death of player:
  121. if {ingame::*} contains victim:
  122. if attacker is not a player:
  123. elim("%victim%" parsed as offlineplayer)
  124. else:
  125. elim("%victim%" parsed as offlineplayer, "&7was eliminated by &e%attacker%")
  126.  
  127. command /resetGame [<text>]:
  128. permission: op
  129. permission message: &cno
  130. trigger:
  131. delete {started}
  132. delete {start}
  133. delete {ingame::*}
  134.  
  135. command /addloc [<text>]:
  136. permission: op
  137. permission message: &cno
  138. trigger:
  139. add location of block at player to {chestLoc::*}
  140. send formatted "&6&lMHDrop &7Added a chest location to &e%location of block at player%&7!"
  141.  
  142. command /addloot [<text>]:
  143. permission: op
  144. permission message: &cno
  145. trigger:
  146. if player's tool is not air:
  147. add player's tool to {lootTable::*}
  148. send formatted "&6&lMHDrop &7Added &e%player's tool% &7to the loot table."
  149. else:
  150. send formatted "&6&lMHDrop &7Please hold an item."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement