Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. rightclick on sign:
  2. Queue(player) if {GameRunning?} is not set
  3. send "Game is currently running" if {GameRunning?} is set
  4.  
  5. function Queue(p: player):
  6. {Queue::*} contains {_p}:
  7. remove {_p} from {Queue::*}
  8. send "&cYou left the queue." to {_p}
  9. else:
  10. add {_p} to {Queue::*}
  11. send "&aYou joined the queue." to {_p}
  12. if size of {Queue::*} > 1:
  13. Timer()
  14.  
  15. function Timer():
  16. set {_timer} to 10
  17. while {_timer} != 0:
  18. broadcast "&eAnvilDrops &8» &7The game will start in %{_timer}% seconds!" if mod({_timer},5) = 0
  19. broadcast "&eAnvilDrops &8» &7The game will start in %{_timer}% second%Plural({_timer})%!" if {_timer} <= 5
  20. remove 1 from {_timer}
  21. wait second
  22. broadcast "The game starts!"
  23. Start()
  24.  
  25. function Start():
  26. size of {Queue::*} > 1:
  27. set {GameRunning?} to true
  28. set {Round} to 1
  29. loop {Queue::*}:
  30. set {_x} to random number between -168.3 and -181.7
  31. set {_z} to random number between -109.3 and -133.7
  32. teleport loop-value to location({_x}, 169, {_z}, world("world"), 0.01, 0.01)
  33. else:
  34. broadcast "&cNot enough players to start!"
  35.  
  36. every 5 seconds:
  37. {GameRunning?} is true
  38. set {_Drop} to 10*1.1^({Round}-1)
  39. set {_Drop} to 349 if {_Drop} > 349
  40. broadcast "&eAnvilDrops &8» &dRound &b%{Round}%&d: &b%round({_Drop})% &danvils!"
  41. loop {_Drop} times:
  42. findloc()
  43. while block at location({x}, 180, {z}, world("world")) is anvil:
  44. findloc()
  45. set block at location({x}, 180, {z}, world("world")) to anvil
  46. add 1 to {Round}
  47.  
  48. disconnect:
  49. remove player from {Queue::*}
  50.  
  51. death:
  52. {Queue::*} contains victim
  53. if size of {Queue::*} > 1:
  54. broadcast "%{Queue::*}% wins!"
  55. loop {Queue::*}:
  56. add 100 to {Coins::%loop-index%}
  57. remove victim from {Queue::*}
  58.  
  59. function findloc():
  60. set {x} to random integer between -169 and -182
  61. set {z} to random integer between -110 and -134
  62.  
  63. command round <number>:
  64. trigger:
  65. set {Round} to arg
  66.  
  67. command resetqueue:
  68. trigger:
  69. clear {Queue::*}
  70. clear {GameRunning?}
  71.  
  72. function Plural(n: number) :: string:
  73. {_n} != 1:
  74. return "s"
  75. else:
  76. return ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement