IkBenCringe

Untitled

Aug 27th, 2021
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.68 KB | None | 0 0
  1. options:
  2. park: &f[&cParkour&f]: &7
  3. variables:
  4. {parkourj.%player%} = false
  5. on unload:
  6. loop all players:
  7. if {parkourj.%loop-player%} is true:
  8. execute loop-player command "/parkour leave"
  9. command /parkour [<text>] [<text>] [<text>]:
  10. trigger:
  11. if arg 1 isn't set:
  12. send "{@park}Commands: &c/parkour help"
  13. if arg 1 is "help":
  14. message "{@park}/parkour join [arena]"
  15. message "{@park}/parkour leave"
  16. message "{@park}/parkour list"
  17. message "{@park}/parkour top [arena]"
  18. message "{@park}/parkour ptop [arena]"
  19. if player is op:
  20. message "{@park}/parkour create [arena]"
  21. message "{@park}/parkour remove [arena]"
  22. message "{@park}/parkour set spawn [arena]"
  23. if arg 1 is "list":
  24. size of {parkourarena::*} = 0:
  25. send "{@park}No arena."
  26. size of {parkourarena::*} > 0:
  27. send "&6--------&7Arenas&6--------"
  28. loop {parkourarena::*}:
  29. send "&a &7- &a%loop-value% &7-"
  30. if arg 1 is "create":
  31. if player is op:
  32. if arg 2 is set:
  33. {parkourarena::*} contains arg 2:
  34. send "{@park}There is already an arena with the same name!"
  35. else:
  36. set {parkourarena::%arg 2%} to arg 2
  37. send "{@park}%arg 2% succesfully created."
  38. else:
  39. send "{@park}Select the arena name."
  40. else:
  41. send "{@park}You don't have permission."
  42. if arg 1 is "remove":
  43. if player is op:
  44. if arg 2 is set:
  45. if {parkourarena::%arg 2%} is set:
  46. delete {parkourarena::%arg 2%}
  47. delete {parkourspawn.%arg 2%}
  48. send "{@park}%arg 2% deleted."
  49. else:
  50. send "{@park}Arena not found"
  51. else:
  52. send "{@park}Select the arena name."
  53. else:
  54. send "{@park}You don't have permission."
  55. if arg 1 is "set":
  56. if player is op:
  57. if arg 2 isn't set:
  58. send "{@park}/parkour set spawn [arena]"
  59. else:
  60. if arg 3 isn't set:
  61. send "{@park}Select the arena name."
  62. else:
  63. if {parkourarena::%arg 3%} isn't set:
  64. send "{@park}Arena not found"
  65. else:
  66. if arg 2 is "spawn":
  67. set {parkourspawn.%arg 3%} to location of player
  68. send "{@park}Spawn set for %arg 3% to %location of player%."
  69. else:
  70. send "{@park}You don't have permission."
  71. if arg 1 is "reset":
  72. if player is op:
  73. if arg 2 is not set:
  74. message "{@park}Usage: /parkour reset [arena] [player]"
  75. else:
  76. if arg 3 is not set:
  77. message "{@park}Usage: /parkour reset [arena] [player]"
  78. else:
  79. if {parkourarena::%arg 2%} isn't set:
  80. send "{@park}Arena not found."
  81. else:
  82. if {parki.%arg-2%::%arg-3%} is not set:
  83. message "{@park}%arg-3%'s time is not set on %arg-2%"
  84. else:
  85. loop {parki.%arg-2%::*}:
  86. if loop-index is arg-3:
  87. remove loop-index from {parki.%arg-2%::*}
  88. remove loop-value from {parki.%arg-2%::*}
  89. clear {parkour.%arg-2%.%arg-3%.highscore}
  90. message "{@park}%arg-3%'s time has been removed from %arg-2%."
  91. if arg 1 is "join":
  92. if arg 2 isn't set:
  93. if size of {parkourarena::*} = 0:
  94. send "{@park}No arena."
  95. else:
  96. open chest with 6 rows named "&8Parkour Arenas" to player
  97. clear {parkarena.amount}
  98. loop {parkourarena::*}:
  99. add 1 to {parkarena.amount}
  100. set slot {parkarena.amount}-1 of player's current inventory to sand named "%loop-value%" with lore "&e&oYour Best Time: &c%{parkour.%loop-value%.%player%.highscore}% ||&7 - &a&oClick to join &7 -"
  101. else:
  102. if {parkourj.%player%} is true:
  103. send "{@park}You have already joined to the game."
  104. else:
  105. if {parkourarena::%arg 2%} isn't set:
  106. send "{@park}Arena not found"
  107. else:
  108. if {parkourspawn.%arg 2%} is not set:
  109. message "{@park}The spawn is not set for %arg 2%!"
  110. else:
  111. set {parkourlastloc.%player%} to player's location
  112. wait 1 tick
  113. teleport player to {parkourspawn.%arg 2%}
  114. set {jelenlegpalya.%player%} to arg-2
  115. send "{@park}You joined to the game!"
  116. set {parkourj.%player%} to true
  117. set {parkourslimetp.%player%} to {parkourspawn.%arg 2%}
  118. add 1 slimeball named "&b&lTeleport to the start" to the player's inventory
  119. effectp(player)
  120. if arg 1 is "leave":
  121. if {parkourj.%player%} is true:
  122. set {parkourj.%player%} to false
  123. teleport player 1 above {parkourlastloc.%player%}
  124. message "{@park}You left the game."
  125. remove all slimeball from player's inventory
  126. set {timer.%player%} to false
  127. else:
  128. message "{@park}You are not in the game."
  129. if arg 1 is "ptop":
  130. if arg 2 is not set:
  131. message "{@park}Select the arena name."
  132. else:
  133. if {parkourarena::%arg 2%} isn't set:
  134. send "{@park}Arena not found"
  135. else:
  136. message "{@park}Your best on %arg-2%: %{parkour.%arg-2%.%player%.highscore}%"
  137. if arg 1 is "top":
  138. if arg 2 is not set:
  139. message "{@park}Select the arena name."
  140. else:
  141. if {parkourarena::%arg 2%} isn't set:
  142. send "{@park}Arena not found"
  143. else:
  144. loop {parki.%arg-2%::*}:
  145. add 1 to {_size}
  146. if {_low.to.high::%loop-value%} is not set:
  147. set {_low.to.high::%loop-value%} to loop-index
  148. else:
  149. set {_n} to 0
  150. loop {_size} times:
  151. set {_n} to {_n}+1
  152. {_low.to.high::%loop-value-1%.%{_n}%} is not set
  153. set {_low.to.high::%loop-value-1%.%{_n}%} to loop-index
  154. stop loop
  155. wait 1 tick
  156. send "&8--- &aBest 5 players on %arg 2% &8---"
  157. loop {_low.to.high::*}:
  158. add 1 to {_result}
  159. send "&c%loop-value% : &e%{parki.%arg-2%::%loop-value%}%"
  160. if {_result} is 5:
  161. stop
  162.  
  163. function effectp(p: player):
  164. remove speed from {_p}
  165. remove jump boost from {_p}
  166. remove invisibility from {_p}
  167. set {_p}'s fly mode to false
  168. on step on diamond block:
  169. if {parkourj.%player%} is true:
  170. set {timer.%player%} to true
  171. set {start.%player%} to now
  172. while {timer.%player%} is true:
  173. set {diff.%player%} to difference between now and {start.%player%}
  174. show an action bar from "&6&lTime: &b&l%{diff.%player%}%" to player
  175. wait 1 tick
  176.  
  177. on step on iron block:
  178. if {parkourj.%player%} is true:
  179. if {timer.%player%} is true:
  180. set {timer.%player%} to false
  181. if {parkour.%{jelenlegpalya.%player%}%.%player%.highscore} is not set:
  182. set {parkour.%{jelenlegpalya.%player%}%.%player%.highscore} to {diff.%player%}
  183. message "{@park}Personal time set."
  184. set {parki.%{jelenlegpalya.%player%}%::%name of player%} to {diff.%player%}
  185. else:
  186. if {diff.%player%} < {parkour.%{jelenlegpalya.%player%}%.%player%.highscore}:
  187. set {parkour.%{jelenlegpalya.%player%}%.%player%.highscore} to {diff.%player%}
  188. message "{@park}New personal best!"
  189. set {parki.%{jelenlegpalya.%player%}%::%name of player%} to {diff.%player%}
  190. set {timer.%player%} to false
  191. execute player command "/parkour leave"
  192. message "{@park}You have succesfully finished the map!"
  193. else:
  194. execute player command "/parkour leave"
  195. message "{@park}You have succesfully finished the map, but the timer wasn't started, because you didn't stepped on the diamond block."
  196. on rightclick with slimeball:
  197. if {parkourj.%player%} is true:
  198. if name of player's tool is "&b&lTeleport to the start":
  199. teleport player to {parkourslimetp.%player%}
  200. set {timer.%player%} to false
  201. on sign change:
  202. if player is op:
  203. if line 1 is "[parkour]":
  204. if line 2 is "join":
  205. set line 1 to "&c&l[&8&lParkour&c&l]"
  206. set line 2 to "&1&lJoin"
  207. if line 2 is "leave":
  208. set line 1 to "&c&l[&8&lParkour&c&l]"
  209. set line 2 to "&1&lLeave"
  210. on click on sign:
  211. if line 1 is "&c&l[&8&lParkour&c&l]":
  212. if line 2 is "&1&lJoin":
  213. make player execute "/parkour join"
  214. if line 2 is "&1&lLeave":
  215. make player execute "/parkour leave"
  216. on command:
  217. if {parkourj.%player%} is true:
  218. if command is not "parkour":
  219. message "{@park}You can't use commands ingame!"
  220. cancel event
  221.  
  222. on inventory click:
  223. if name of player's current inventory is "&8Parkour Arenas":
  224. loop {parkourarena::*}:
  225. if name of clicked item is equal to loop-value:
  226. execute playe r command "/parkour join %loop-value%"
  227. cancel event
  228.  
  229. on quit:
  230. execute player command "/parkour leave"
  231. on drop:
  232. if {parkourj.%player%} is true:
  233. cancel event
  234. on inventory click:
  235. if {parkourj.%player%} is true:
  236. cancel event
  237. on break:
  238. if {parkourj.%player%} is true:
  239. cancel event
  240. on place:
  241. if {parkourj.%player%} is true:
  242. cancel event
  243. on food level change:
  244. if {parkourj.%player%} is true:
  245. cancel event
  246. on damage:
  247. if {parkourj.%victim%} is true:
  248. cancel event
  249.  
  250.  
  251.  
  252.  
  253.  
  254. on right click:
  255. if targeted block is pink stained glass:
  256. broadcast "&c&l%player% Finished the parkour"
  257. give player 2 Nether Star
  258. kill player
Advertisement
Add Comment
Please, Sign In to add comment