Advertisement
Oxalist

Untitled

Apr 21st, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.93 KB | None | 0 0
  1. variables:
  2. {duelaccept::%player%} = "True"
  3. {arenaused} = "False"
  4. {kills::%player%} = 0
  5. {deaths::%player%} = 0
  6.  
  7. command /duel [<player>]:
  8. trigger:
  9. if arg 1 is not set:
  10. send "&8(&2Duels&8) &cCorrect Usage: /duel <player>"
  11. stop
  12. if arg 1 is set:
  13. if {ingame::%player%} is "True":
  14. send "&8(&2Duels&8) &aYou cannot request a duel because you are in a game"
  15. stop
  16. if {duelaccept::%arg 1%} is "True":
  17. json("%arg-1%","&8(&2Duels&8) &aClick to accept &2%player%'s &aduel request||cmd:/duelaccept %player%")
  18. send "&8(&2Duels&8) &aSuccesfully sent a duel request to &2%arg 1%" to player
  19.  
  20. command /duelaccept <player>:
  21. trigger:
  22. if {ingame::%player%} is "True":
  23. send "&8(&2Duels&8) &aYou cannot request a duel because you are in a game"
  24. stop
  25. if {arenaused} is "True":
  26. teleport arg 1 to {arenalobby}
  27. send "&8(&2Duels&8) &aThe arena is currently being used, wait here until they finish" to player
  28. send "&8(&2Duels&8) &aThe arena is currently being used, wait here until they finish" to arg 1
  29. if {arenaused} is "False":
  30. set {arenaused} to "True"
  31. teleport arg 1 to {arenaspawn1}
  32. teleport player to {arenaspawn2}
  33. add 2 to {arenaplayers}
  34. add arg 1 to {arenausers::*}
  35. add player to {arenausers::*}
  36. set {player2} to player
  37. set {player1} to arg 1
  38. set {ingame::%player%} to "True"
  39. set {ingame::%arg 1%} to "True"
  40. set {gamestarting::%player%} to "True"
  41. set {gamestarting::%arg 1%} to "True"
  42. send "&8(&2Duels&8) &aThe game will start in &25 &aseconds" to arg 1
  43. send "&8(&2Duels&8) &aThe game will start in &25 &aseconds" to player
  44. wait 1 second
  45. send "&8(&2Duels&8) &aThe game will start in &24 &aseconds" to arg 1
  46. send "&8(&2Duels&8) &aThe game will start in &24 &aseconds" to player
  47. wait 1 second
  48. send "&8(&2Duels&8) &aThe game will start in &23 &aseconds" to arg 1
  49. send "&8(&2Duels&8) &aThe game will start in &23 &aseconds" to player
  50. wait 1 second
  51. send "&8(&2Duels&8) &aThe game will start in &22 &aseconds" to arg 1
  52. send "&8(&2Duels&8) &aThe game will start in &22 &aseconds" to player
  53. wait 1 second
  54. send "&8(&2Duels&8) &aThe game will start in &21 &asecond" to arg 1
  55. send "&8(&2Duels&8) &aThe game will start in &21 &asecond" to player
  56. wait 1 second
  57. send "&8(&2Duels&8) &aThe game has started" to arg 1
  58. send "&8(&2Duels&8) &aThe game has started" to player
  59. set {gamestarting::%player%} to "False"
  60. set {gamestarting::%arg 1%} to "False"
  61.  
  62.  
  63. on death:
  64. if victim is a player:
  65. if attacker is a player:
  66. remove 1 from {arenaplayers}
  67. remove victim from {arenausers::*}
  68. set {ingame::%Victim%} to "False"
  69. add 1 to {kills::%attacker%}
  70. add 1 to {death::%victim%}
  71. clear drops
  72.  
  73. command /test:
  74. trigger:
  75. send "%{arenausers::*}%"
  76.  
  77. command /resetarena:
  78. trigger:
  79. set {arenaused} to "False"
  80. delete {arenausers::*}
  81. delete {arenaplayers}
  82.  
  83. every tick:
  84. loop all players:
  85. if {arenaused} is "True":
  86. if {arenaplayers} is less than 2:
  87. broadcast "&8(&2Duels&8) &2%{arenausers::*}% &Ahas won the duel"
  88. delete {arenausers::*}
  89. delete {arenaplayers}
  90. delete {player1}
  91. delete {player2}
  92. teleport loop-player to {lobby}
  93. set {arenaused} to "False"
  94. set {ingame::%loop-player%} to "False"
  95.  
  96. on any movement:
  97. if {gamestarting::%player%} is "True":
  98. cancel event
  99. send "&8(&2Duels&8) &aYou cannot move while the game is starting"
  100.  
  101. command /arena [<text>]:
  102. permission: arena.set
  103. trigger:
  104. if arg 1 is "setspawn1":
  105. set {arenaspawn1} to location of player
  106. send "&8(&2Duels&8) &aSet arena spawn point 1 to your location"
  107. if arg 1 is "setspawn2":
  108. set {arenaspawn2} to location of player
  109. send "&8(&2Duels&8) &aSet arena spawn point 2 to your location"
  110. if arg 1 is "arenalobby":
  111. set {arenalobby} to location of player
  112. send "&8(&2Duels&8) &aSet arena lobby to your location"
  113.  
  114. every second:
  115. loop all players:
  116. if {ingame::%loop-player%} is "True":
  117. set {_now} to "%now%"
  118. wipe loop-player's sidebar
  119. set name of sidebar of loop-player to "&e&lDUELS"
  120. set score "&7%{_now}%" in sidebar of loop-player to 7
  121. set score "&a" in sidebar of loop-player to 6
  122. set score "&e%{player1}% &a%health of {player1}% &c&lā¤" in sidebar of loop-player to 5
  123. set score "&e%{player2}% &a%health of {player2}% &c&lā¤" in sidebar of loop-player to 4
  124. set score "&2" in sidebar of loop-player to 3
  125. set score "&fMap: &aHigh Vally" in sidebar of loop-player to 2
  126. set score "&6" in sidebar of loop-player to 1
  127. if {ingame::%loop-player%} is "False":
  128. set {_now} to "%now%"
  129. wipe loop-player's sidebar
  130. set name of sidebar of loop-player to "&e&lDUELS LOBBY"
  131. set score " &7%{_now}%" in sidebar of loop-player to 5
  132. set score "&a" in sidebar of loop-player to 4
  133. set score " &fKills: &a%{kills::%loop-player%}%" in sidebar of loop-player to 3
  134. set score " &fDeaths: &a%{deaths::%loop-player%}%" in sidebar of loop-player to 2
  135. set score "&6" in sidebar of loop-player to 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement