Advertisement
Cool_Colton

Untitled

Aug 4th, 2020
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.02 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. if event-block is south facing chest:
  221. set {_facing} to south
  222. cancel event
  223. set {_d} to location of event-block
  224. set {_d} to rounded {_d}
  225. create new gui with id "crate" with virtual chest named " &8>=&b&lCRATES&8=<" with 5 rows
  226. open gui with id "crate" to player
  227. loop all integers between 0 and 21:
  228. format gui slot loop-value-2 of player with gray glass panes named ""
  229. loop all integers between 22 and 23:
  230. format gui slot loop-value-2 of player with gray glass panes named ""
  231. loop all integers between 25 and 25:
  232. format gui slot loop-value-2 of player with gray glass panes named ""
  233. loop all integers between 27 and 58:
  234. format gui slot loop-value-2 of player with gray glass panes named ""
  235. set {_t} to x coordinate of event-block
  236. set {_d} to y coordinate of event-block
  237. set {_g} to z coordinate of event-block
  238. set {_nochange} to location of event-block
  239. set {_nochange} to rounded {_nochange}
  240. set {_p} to player
  241. format gui slot 20 of player with chest named "&aRookie Crate &8(%{crates::rookie::%player's uuid%}%)" to close:
  242. if {crates::rookie::%player's uuid%} is more than 0:
  243. add 1 to {_d}
  244. loop {d::rookie::*}:
  245. add loop-value to {_s}
  246. if {_facing} is south:
  247. add 1.5 to {_t}
  248. set {_h} to location({_t}, {_d}, {_g}, world "world", 180)
  249. summon a armor stand at {_h}
  250. add "{Invisible:1b,Invulnerable:1b,ArmorItems:[{},{},{},{id:""diamond_sword"",Count:1b}],HandItems:[{},{}],Pose:{Head:[0f,0f,110f]}}" to nbt of last spawned entity
  251. set {_o} to last spawned entity
  252. whileAlive({_o})
  253. subtract 3 from {_t}
  254. add 0.5 to {_g}
  255. set {_h} to location({_t}, {_d}, {_g}, world "world")
  256. summon a armor stand at {_h}
  257. add "{Invisible:1b,Invulnerable:1b,ArmorItems:[{},{},{},{id:""diamond_sword"",Count:1b}],HandItems:[{},{}],Pose:{Head:[0f,0f,110f]}}" to nbt of last spawned entity
  258. set {_o2} to last spawned entity
  259. whileAlive({_o2})
  260. loop 7 times:
  261. push {_o} down with force 0.16
  262. push {_o} west with force 0.0068
  263. push {_o2} down with force 0.16
  264. push {_o2} east with force 0.0068
  265. wait 1 tick
  266. play chest open animation at block at {_nochange} for all players
  267. wait 1.5 seconds
  268. set {_m} to the x coord of {_nochange}
  269. set {_b} to the y coord of {_nochange} - 1
  270. set {_n} to the z coord of {_nochange}
  271. add .3 to {_b}
  272.  
  273. # WIN ITEMS
  274. set {_h} to a random integer between 1 and 10000
  275. # 100 is 1%, 1000 is 10%, 10000 is 100%
  276. if {_h} is between 1 and 1000:
  277. summon a armor stand at location({_m}, {_b}, {_n}, world "world")
  278. add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
  279. set helmet of last spawned entity to diamond sword
  280. set {_o3} to last spawned entity
  281. whileAlive({_o3})
  282. else if {_h} is between 1001 and 5000:
  283. summon a armor stand at location({_m}, {_b}, {_n}, world "world")
  284. add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
  285. set helmet of last spawned entity to diamond ore
  286. set {_o3} to last spawned entity
  287. whileAlive({_o3})
  288. else if {_h} is between 5001 and 10000:
  289. summon a armor stand at location({_m}, {_b}, {_n}, world "world")
  290. add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
  291. set helmet of last spawned entity to diamond block
  292. set {_o3} to last spawned entity
  293. whileAlive({_o3})
  294. # END OF WIN ITEMS
  295.  
  296.  
  297. kill {_o}
  298. kill {_o2}
  299. wait 3.5 seconds
  300. play chest close animation at block at {_nochange} for all players
  301. kill {_o3}
  302. else:
  303. send "You do not have a key for this crate"
  304.  
  305.  
  306. format gui slot 22 of player with chest named "&aAncient Crate &8(%{crates::ancient::%player's uuid%}%)" to close:
  307. if {crates::ancient::%player's uuid%} is more than 0:
  308. add 1 to {_d}
  309. loop {d::rookie::*}:
  310. add loop-value to {_s}
  311. if {_facing} is south:
  312. add 1.5 to {_t}
  313. set {_h} to location({_t}, {_d}, {_g}, world "world", 180)
  314. summon a armor stand at {_h}
  315. add "{Invisible:1b,Invulnerable:1b,ArmorItems:[{},{},{},{id:""diamond_sword"",Count:1b}],HandItems:[{},{}],Pose:{Head:[0f,0f,110f]}}" to nbt of last spawned entity
  316. set {_o} to last spawned entity
  317. whileAlive({_o})
  318. subtract 3 from {_t}
  319. add 0.5 to {_g}
  320. set {_h} to location({_t}, {_d}, {_g}, world "world")
  321. summon a armor stand at {_h}
  322. add "{Invisible:1b,Invulnerable:1b,ArmorItems:[{},{},{},{id:""diamond_sword"",Count:1b}],HandItems:[{},{}],Pose:{Head:[0f,0f,110f]}}" to nbt of last spawned entity
  323. set {_o2} to last spawned entity
  324. whileAlive({_o2})
  325. loop 7 times:
  326. push {_o} down with force 0.16
  327. push {_o} west with force 0.0068
  328. push {_o2} down with force 0.16
  329. push {_o2} east with force 0.0068
  330. wait 1 tick
  331. play chest open animation at block at {_nochange} for all players
  332. wait 1.5 seconds
  333. set {_m} to the x coord of {_nochange}
  334. set {_b} to the y coord of {_nochange} - 1
  335. set {_n} to the z coord of {_nochange}
  336. add .3 to {_b}
  337.  
  338. # WIN ITEMS
  339. set {_h} to a random integer between 1 and 10000
  340. # 100 is 1%, 1000 is 10%, 10000 is 100%
  341. if {_h} is between 1 and 1000:
  342. summon a armor stand at location({_m}, {_b}, {_n}, world "world")
  343. add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
  344. set helmet of last spawned entity to diamond sword
  345. set {_o3} to last spawned entity
  346. whileAlive({_o3})
  347. else if {_h} is between 1001 and 5000:
  348. summon a armor stand at location({_m}, {_b}, {_n}, world "world")
  349. add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
  350. set helmet of last spawned entity to diamond ore
  351. set {_o3} to last spawned entity
  352. whileAlive({_o3})
  353. else if {_h} is between 5001 and 10000:
  354. summon a armor stand at location({_m}, {_b}, {_n}, world "world")
  355. add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
  356. set helmet of last spawned entity to diamond block
  357. set {_o3} to last spawned entity
  358. whileAlive({_o3})
  359. # END OF WIN ITEMS
  360.  
  361.  
  362. kill {_o}
  363. kill {_o2}
  364. wait 3.5 seconds
  365. play chest close animation at block at {_nochange} for all players
  366. kill {_o3}
  367. else:
  368. send "You do not have a key for this crate"
  369.  
  370.  
  371. format gui slot 24 of player with chest named "&aMythical Crate &8(%{crates::mythical::%player's uuid%}%)" to close:
  372. if {crates::mythical::%player's uuid%} is more than 0:
  373. add 1 to {_d}
  374. loop {d::rookie::*}:
  375. add loop-value to {_s}
  376. if {_facing} is south:
  377. add 1.5 to {_t}
  378. set {_h} to location({_t}, {_d}, {_g}, world "world", 180)
  379. summon a armor stand at {_h}
  380. add "{Invisible:1b,Invulnerable:1b,ArmorItems:[{},{},{},{id:""diamond_sword"",Count:1b}],HandItems:[{},{}],Pose:{Head:[0f,0f,110f]}}" to nbt of last spawned entity
  381. set {_o} to last spawned entity
  382. whileAlive({_o})
  383. subtract 3 from {_t}
  384. add 0.5 to {_g}
  385. set {_h} to location({_t}, {_d}, {_g}, world "world")
  386. summon a armor stand at {_h}
  387. add "{Invisible:1b,Invulnerable:1b,ArmorItems:[{},{},{},{id:""diamond_sword"",Count:1b}],HandItems:[{},{}],Pose:{Head:[0f,0f,110f]}}" to nbt of last spawned entity
  388. set {_o2} to last spawned entity
  389. whileAlive({_o2})
  390. loop 7 times:
  391. push {_o} down with force 0.16
  392. push {_o} west with force 0.0068
  393. push {_o2} down with force 0.16
  394. push {_o2} east with force 0.0068
  395. wait 1 tick
  396. play chest open animation at block at {_nochange} for all players
  397. wait 1.5 seconds
  398. set {_m} to the x coord of {_nochange}
  399. set {_b} to the y coord of {_nochange} - 1
  400. set {_n} to the z coord of {_nochange}
  401. add .3 to {_b}
  402.  
  403. # WIN ITEMS
  404. set {_h} to a random integer between 1 and 10000
  405. # 100 is 1%, 1000 is 10%, 10000 is 100%
  406. if {_h} is between 1 and 1000:
  407. summon a armor stand at location({_m}, {_b}, {_n}, world "world")
  408. add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
  409. set helmet of last spawned entity to diamond sword
  410. set {_o3} to last spawned entity
  411. whileAlive({_o3})
  412. else if {_h} is between 1001 and 5000:
  413. summon a armor stand at location({_m}, {_b}, {_n}, world "world")
  414. add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
  415. set helmet of last spawned entity to diamond ore
  416. set {_o3} to last spawned entity
  417. whileAlive({_o3})
  418. else if {_h} is between 5001 and 10000:
  419. summon a armor stand at location({_m}, {_b}, {_n}, world "world")
  420. add "{Invisible:1b,ShowArms:1b}" to nbt of last spawned entity
  421. set helmet of last spawned entity to diamond block
  422. set {_o3} to last spawned entity
  423. whileAlive({_o3})
  424. # END OF WIN ITEMS
  425.  
  426.  
  427. kill {_o}
  428. kill {_o2}
  429. wait 3.5 seconds
  430. play chest close animation at block at {_nochange} for all players
  431. kill {_o3}
  432. else:
  433. send "You do not have a key for this crate"
  434.  
  435.  
  436.  
  437. command /setcrates <player> <text> <integer>:
  438. permission: set.crates
  439. trigger:
  440. set {crates::%arg 2%::%arg-1's uuid%} to arg 3
  441.  
  442.  
  443.  
  444. on join:
  445. if {crates::rookie::%player's uuid%} is not set:
  446. set {crates::rookie::%player's uuid%} to 0
  447. if {crates::ancient::%player's uuid%} is not set:
  448. set {crates::ancient::%player's uuid%} to 0
  449. if {crates::mythical::%player's uuid%} is not set:
  450. set {crates::mythical::%player's uuid%} to 0
  451.  
  452.  
  453.  
  454. function whileAlive(E: entity):
  455. while {_E} is alive:
  456. set {_V} to velocity of {_E}
  457. set velocity of {_E} to vector(x of {_V}, 0, z of {_V})
  458. wait 1 tick
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement