Advertisement
Guest User

Untitled

a guest
Dec 14th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. function spawn(p: offlineplayer):
  2. teleport {_p} to spawn of world "world"
  3. heal {_p}
  4. feed {_p}
  5. clear {_p}'s inventory
  6.  
  7.  
  8. on right click:
  9. if event-block is sign:
  10. if line 3 of event-block contains "sumo":
  11. if {insumo::*} contains player:
  12. send "&cYou can not toggle queue while ingame!" to player
  13. stop
  14. if {insumoqueue::*} contains player:
  15. send "&cYou have left the sumo queue!" to player
  16. spawn(player)
  17. remove player from {insumoqueue::*}
  18. stop
  19. if size of {insumo::*} is not 0:
  20. send "&cA game is currently progressing!"
  21. stop
  22. send "&aYou have joined the sumo queue!" to player
  23. add player to {insumoqueue::*}
  24. teleport player to {sumo::center}
  25. set player's gamemode to survival
  26. sumoStart()
  27.  
  28. function sumoStart():
  29. wait 1 second
  30.  
  31. send title "&a&lThe game will start in 10 seconds" to all players where [{insumoqueue::*} contains input] for 1 second
  32. wait 5 seconds
  33. set {_cd} to 5
  34. while {_cd} > 0:
  35. send title "&a&l%{_cd}%" to all players where [{insumoqueue::*} contains input] for 1 second
  36. wait 1 second
  37. set {_cd} to {_cd} - 1
  38. send title "&a&lStart!" to all players where [{insumoqueue::*} contains input] for 1 second
  39. loop all players where [{insumoqueue::*} contains input]:
  40. give loop-player stick named "Sumo Stick"
  41.  
  42. function checkWinner():
  43. if size of {insumoqueue::*} <= 1:
  44. set {_winner} to first element out of {insumo::*}
  45. broadcast "&3&lSumo &7The winner of the sumo round is &3%{_winner} ? (""No one"")%&7!"
  46. if {_winner} is set:
  47. add 1 to {sumowins::%{_winner}%}
  48. clear {insumo::*}
  49. clear {insumoqueue::*}
  50. spawn({_winner})
  51. clear {_winner}'s inventory
  52.  
  53. on damage of player:
  54. if attacker is a player:
  55. if {insumoqueue::*} contains attacker:
  56. if attacker is holding stick:
  57. set damage to 0
  58. else:
  59. cancel event
  60. else if "%damage cause%" is "void":
  61. set victim's flight mode to true
  62. spawn(victim)
  63. set victim's flight mode to false
  64. checkWinner()
  65. if {insumoqueue::*} contains player:
  66. remove player from {insumoqueue::*}
  67. remove player from {insumo::*}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement