Advertisement
Cool_Colton

Untitled

Aug 4th, 2020
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.48 KB | None | 0 0
  1. on right click on chest:
  2. if event-block is south facing chest:
  3. set {_facing} to south
  4. cancel event
  5. set {_d} to location of event-block
  6. set {_d} to rounded {_d}
  7. create new gui with id "crate" with virtual chest named " &8>=&b&lCRATES&8=<" with 5 rows
  8. open gui with id "crate" to player
  9. loop all integers between 0 and 21:
  10. format gui slot loop-value-2 of player with gray glass panes named ""
  11. loop all integers between 22 and 23:
  12. format gui slot loop-value-2 of player with gray glass panes named ""
  13. loop all integers between 25 and 25:
  14. format gui slot loop-value-2 of player with gray glass panes named ""
  15. loop all integers between 27 and 58:
  16. format gui slot loop-value-2 of player with gray glass panes named ""
  17. set {_t} to x coordinate of event-block
  18. set {_d} to y coordinate of event-block
  19. set {_g} to z coordinate of event-block
  20. set {_nochange} to location of event-block
  21. set {_nochange} to rounded {_nochange}
  22. set {_p} to player
  23. format gui slot 20 of player with chest named "&aRookie Crate &8(%{crates::rookie::%player's uuid%}%)" to close:
  24. if {crates::rookie::%player's uuid%} is more than 0:
  25. add 1 to {_d}
  26. loop {d::rookie::*}:
  27. add loop-value to {_s}
  28. if {_facing} is south:
  29. add 1.5 to {_t}
  30. set {_h} to location({_t}, {_d}, {_g}, world "world", 180)
  31. summon a armor stand at {_h}
  32. add "{Invisible:1b,Invulnerable:1b,ArmorItems:[{},{},{},{id:""diamond_sword"",Count:1b}],HandItems:[{},{}],Pose:{Head:[0f,0f,110f]}}" to nbt of last spawned entity
  33. set {_o} to last spawned entity
  34. whileAlive({_o})
  35. subtract 3 from {_t}
  36. add 0.5 to {_g}
  37. set {_h} to location({_t}, {_d}, {_g}, world "world")
  38. summon a armor stand at {_h}
  39. add "{Invisible:1b,Invulnerable:1b,ArmorItems:[{},{},{},{id:""diamond_sword"",Count:1b}],HandItems:[{},{}],Pose:{Head:[0f,0f,110f]}}" to nbt of last spawned entity
  40. set {_o2} to last spawned entity
  41. whileAlive({_o2})
  42. loop 7 times:
  43. push {_o} down with force 0.16
  44. push {_o} west with force 0.0068
  45. push {_o2} down with force 0.16
  46. push {_o2} east with force 0.0068
  47. wait 1 tick
  48. play chest open animation at block at {_nochange} for all players
  49. wait 1.5 seconds
  50. set {_m} to the x coord of {_nochange}
  51. set {_b} to the y coord of {_nochange} - 1
  52. set {_n} to the z coord of {_nochange}
  53. add .3 to {_b}
  54.  
  55. # WIN ITEMS
  56. set {_h} to a random integer between 1 and 10000
  57. # 100 is 1%, 1000 is 10%, 10000 is 100%
  58. if {_h} is between 1 and 1000:
  59. summon a armor stand at location({_m}, {_b}, {_n}, world "world")
  60. add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
  61. set helmet of last spawned entity to diamond sword
  62. set {_o3} to last spawned entity
  63. whileAlive({_o3})
  64. else if {_h} is between 1001 and 5000:
  65. summon a armor stand at location({_m}, {_b}, {_n}, world "world")
  66. add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
  67. set helmet of last spawned entity to diamond ore
  68. set {_o3} to last spawned entity
  69. whileAlive({_o3})
  70. else if {_h} is between 5001 and 10000:
  71. summon a armor stand at location({_m}, {_b}, {_n}, world "world")
  72. add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
  73. set helmet of last spawned entity to diamond block
  74. set {_o3} to last spawned entity
  75. whileAlive({_o3})
  76. # END OF WIN ITEMS
  77.  
  78.  
  79. kill {_o}
  80. kill {_o2}
  81. wait 3.5 seconds
  82. play chest close animation at block at {_nochange} for all players
  83. kill {_o3}
  84. else:
  85. send "You do not have a key for this crate"
  86.  
  87.  
  88. format gui slot 22 of player with chest named "&aAncient Crate &8(%{crates::ancient::%player's uuid%}%)" to close:
  89. if {crates::ancient::%player's uuid%} is more than 0:
  90. add 1 to {_d}
  91. loop {d::rookie::*}:
  92. add loop-value to {_s}
  93. if {_facing} is south:
  94. add 1.5 to {_t}
  95. set {_h} to location({_t}, {_d}, {_g}, world "world", 180)
  96. summon a armor stand at {_h}
  97. add "{Invisible:1b,Invulnerable:1b,ArmorItems:[{},{},{},{id:""diamond_sword"",Count:1b}],HandItems:[{},{}],Pose:{Head:[0f,0f,110f]}}" to nbt of last spawned entity
  98. set {_o} to last spawned entity
  99. whileAlive({_o})
  100. subtract 3 from {_t}
  101. add 0.5 to {_g}
  102. set {_h} to location({_t}, {_d}, {_g}, world "world")
  103. summon a armor stand at {_h}
  104. add "{Invisible:1b,Invulnerable:1b,ArmorItems:[{},{},{},{id:""diamond_sword"",Count:1b}],HandItems:[{},{}],Pose:{Head:[0f,0f,110f]}}" to nbt of last spawned entity
  105. set {_o2} to last spawned entity
  106. whileAlive({_o2})
  107. loop 7 times:
  108. push {_o} down with force 0.16
  109. push {_o} west with force 0.0068
  110. push {_o2} down with force 0.16
  111. push {_o2} east with force 0.0068
  112. wait 1 tick
  113. play chest open animation at block at {_nochange} for all players
  114. wait 1.5 seconds
  115. set {_m} to the x coord of {_nochange}
  116. set {_b} to the y coord of {_nochange} - 1
  117. set {_n} to the z coord of {_nochange}
  118. add .3 to {_b}
  119.  
  120. # WIN ITEMS
  121. set {_h} to a random integer between 1 and 10000
  122. # 100 is 1%, 1000 is 10%, 10000 is 100%
  123. if {_h} is between 1 and 1000:
  124. summon a armor stand at location({_m}, {_b}, {_n}, world "world")
  125. add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
  126. set helmet of last spawned entity to diamond sword
  127. set {_o3} to last spawned entity
  128. whileAlive({_o3})
  129. else if {_h} is between 1001 and 5000:
  130. summon a armor stand at location({_m}, {_b}, {_n}, world "world")
  131. add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
  132. set helmet of last spawned entity to diamond ore
  133. set {_o3} to last spawned entity
  134. whileAlive({_o3})
  135. else if {_h} is between 5001 and 10000:
  136. summon a armor stand at location({_m}, {_b}, {_n}, world "world")
  137. add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
  138. set helmet of last spawned entity to diamond block
  139. set {_o3} to last spawned entity
  140. whileAlive({_o3})
  141. # END OF WIN ITEMS
  142.  
  143.  
  144. kill {_o}
  145. kill {_o2}
  146. wait 3.5 seconds
  147. play chest close animation at block at {_nochange} for all players
  148. kill {_o3}
  149. else:
  150. send "You do not have a key for this crate"
  151.  
  152.  
  153. format gui slot 24 of player with chest named "&aMythical Crate &8(%{crates::mythical::%player's uuid%}%)" to close:
  154. if {crates::mythical::%player's uuid%} is more than 0:
  155. add 1 to {_d}
  156. loop {d::rookie::*}:
  157. add loop-value to {_s}
  158. if {_facing} is south:
  159. add 1.5 to {_t}
  160. set {_h} to location({_t}, {_d}, {_g}, world "world", 180)
  161. summon a armor stand at {_h}
  162. add "{Invisible:1b,Invulnerable:1b,ArmorItems:[{},{},{},{id:""diamond_sword"",Count:1b}],HandItems:[{},{}],Pose:{Head:[0f,0f,110f]}}" to nbt of last spawned entity
  163. set {_o} to last spawned entity
  164. whileAlive({_o})
  165. subtract 3 from {_t}
  166. add 0.5 to {_g}
  167. set {_h} to location({_t}, {_d}, {_g}, world "world")
  168. summon a armor stand at {_h}
  169. add "{Invisible:1b,Invulnerable:1b,ArmorItems:[{},{},{},{id:""diamond_sword"",Count:1b}],HandItems:[{},{}],Pose:{Head:[0f,0f,110f]}}" to nbt of last spawned entity
  170. set {_o2} to last spawned entity
  171. whileAlive({_o2})
  172. loop 7 times:
  173. push {_o} down with force 0.16
  174. push {_o} west with force 0.0068
  175. push {_o2} down with force 0.16
  176. push {_o2} east with force 0.0068
  177. wait 1 tick
  178. play chest open animation at block at {_nochange} for all players
  179. wait 1.5 seconds
  180. set {_m} to the x coord of {_nochange}
  181. set {_b} to the y coord of {_nochange} - 1
  182. set {_n} to the z coord of {_nochange}
  183. add .3 to {_b}
  184.  
  185. # WIN ITEMS
  186. set {_h} to a random integer between 1 and 10000
  187. # 100 is 1%, 1000 is 10%, 10000 is 100%
  188. if {_h} is between 1 and 1000:
  189. summon a armor stand at location({_m}, {_b}, {_n}, world "world")
  190. add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
  191. set helmet of last spawned entity to diamond sword
  192. set {_o3} to last spawned entity
  193. whileAlive({_o3})
  194. else if {_h} is between 1001 and 5000:
  195. summon a armor stand at location({_m}, {_b}, {_n}, world "world")
  196. add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
  197. set helmet of last spawned entity to diamond ore
  198. set {_o3} to last spawned entity
  199. whileAlive({_o3})
  200. else if {_h} is between 5001 and 10000:
  201. summon a armor stand at location({_m}, {_b}, {_n}, world "world")
  202. add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
  203. set helmet of last spawned entity to diamond block
  204. set {_o3} to last spawned entity
  205. whileAlive({_o3})
  206. # END OF WIN ITEMS
  207.  
  208.  
  209. kill {_o}
  210. kill {_o2}
  211. wait 3.5 seconds
  212. play chest close animation at block at {_nochange} for all players
  213. kill {_o3}
  214. else:
  215. send "You do not have a key for this crate"
  216.  
  217.  
  218.  
  219. on left click on chest:
  220. cancel event
  221. play chest open animation at event-block for player
  222. wait 10 seconds
  223. play chest close animation at event-block for player
  224.  
  225.  
  226.  
  227. command /setcrates <player> <text> <integer>:
  228. permission: set.crates
  229. trigger:
  230. set {crates::%arg 2%::%arg-1's uuid%} to arg 3
  231.  
  232.  
  233.  
  234. on join:
  235. if {crates::rookie::%player's uuid%} is not set:
  236. set {crates::rookie::%player's uuid%} to 0
  237. if {crates::ancient::%player's uuid%} is not set:
  238. set {crates::ancient::%player's uuid%} to 0
  239. if {crates::mythical::%player's uuid%} is not set:
  240. set {crates::mythical::%player's uuid%} to 0
  241.  
  242.  
  243.  
  244. function whileAlive(E: entity):
  245. while {_E} is alive:
  246. set {_V} to velocity of {_E}
  247. set velocity of {_E} to vector(x of {_V}, 0, z of {_V})
  248. wait 1 tick
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement