Advertisement
Guest User

Untitled

a guest
May 3rd, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. options:
  2. prefix: &8[&c&lMegaCrates&8]&e
  3. key-item: tripwire hook
  4. crate-block: ender chest
  5. animation: true
  6. animation-length: 8
  7. # animation-length specifies length of animation IN SECONDS
  8. no-key-explosion: false
  9. # doesn't push player back so hard if he doesn't have key and this is false
  10. open-messages: true
  11. # here you can set which items will be in opening animation as border
  12.  
  13. command /megacrates [<text>] [<text>] [<player>]:
  14. trigger:
  15. if arg 1 isn't set:
  16. make player execute command "crate"
  17. else if arg 1 is set:
  18. if arg 2 isn't set:
  19. make player execute command "crate %arg 1%"
  20. else if arg 2 is set:
  21. if arg 3 isn't set:
  22. make player execute command "crate %arg 1% %arg 2%"
  23. else if arg 3 is set:
  24. make player execute command "crate %arg 1% %arg 2% %arg 3%"
  25.  
  26. command /megacrate [<text>] [<text>] [<player>]:
  27. trigger:
  28. if arg 1 isn't set:
  29. make player execute command "crate"
  30. else if arg 1 is set:
  31. if arg 2 isn't set:
  32. make player execute command "crate %arg 1%"
  33. else if arg 2 is set:
  34. if arg 3 isn't set:
  35. make player execute command "crate %arg 1% %arg 2%"
  36. else if arg 3 is set:
  37. make player execute command "crate %arg 1% %arg 2% %arg 3%"
  38.  
  39. command /crates [<text>] [<text>] [<player>]:
  40. trigger:
  41. if arg 1 isn't set:
  42. make player execute command "crate"
  43. else if arg 1 is set:
  44. if arg 2 isn't set:
  45. make player execute command "crate %arg 1%"
  46. else if arg 2 is set:
  47. if arg 3 isn't set:
  48. make player execute command "crate %arg 1% %arg 2%"
  49. else if arg 3 is set:
  50. make player execute command "crate %arg 1% %arg 2% %arg 3%"
  51.  
  52. command /crate [<text>] [<text>] [<player>]:
  53. trigger:
  54. if arg 1 isn't set:
  55. message " &2>> {@prefix} &a&lv1.3"
  56. message " "
  57. message "&b/crate give <name> <player> &eGives crate key to specified player."
  58. message "&b/crate create <name> &eCreates new crate with specified name."
  59. message "&b/crate additem <name> &eAdds item that you're holding to specified crate."
  60. message "&b/crate removeitem <name> &eRemoves last item that has been added into crate."
  61. message "&b/crate place <name> &ePlaces crate to place you're looking at."
  62. message "&b/crate delete <name> &eDeletes specified crate."
  63. message " "
  64. message " &cCreated by PiskotPiskotovic"
  65. else if arg 1 is "give":
  66. if player has permission "megacrates.give":
  67. if arg 2 is set:
  68. if {Crate.%arg 2%} is set:
  69. if arg 3 is set:
  70. message " {@prefix} &eYou've given &c&l%arg 2% &ckey&e to &a%arg 3%!&e"
  71. give 1 {@key-item} named "&c&l%arg 2% key" to arg 3
  72. else:
  73. message " {@prefix} &cYou didn't specify any player!"
  74. else:
  75. message " {@prefix} &cThat crate doesn't exist."
  76. else:
  77. message "{@prefix} &cYou didn't specify crate name!"
  78. else:
  79. message " {@prefix} &cIt looks like that you don't have permission."
  80. else if arg 1 is "create":
  81. if player has permission "megacrates.admin":
  82. if arg 2 is set:
  83. if {Crate.%arg 2%} isn't set:
  84. message " {@prefix} &eCrate named &a%arg 2% &ehas been set!"
  85. set {Crate.%arg 2%} to true
  86. else:
  87. message " {@prefix} &cCrate with that name already exists!"
  88. else:
  89. message " {@prefix} &cYou didn't specify crate name!"
  90. else:
  91. message " {@prefix} &cIt looks like that you don't have permission."
  92. else if arg 1 is "additem":
  93. if player has permission "megacrates.admin":
  94. if arg 2 is set:
  95. if {Crate.%arg 2%} is set:
  96. if player's tool isn't air:
  97. message " {@prefix} &eYou've successfully added new item to crate &a%arg 2%&e!"
  98. add 1 to {CrateItemsTotal.%arg 2%}
  99. set {CrateItem.%arg 2%::%{CrateItemsTotal.%arg 2%}%} to player's tool
  100. else:
  101. message " {@prefix} &cYou can't add air to things players can win..."
  102. else:
  103. message " {@prefix} &cThat crate doesn't exist!"
  104. else:
  105. message " {@prefix} &cYou didn't specify crate name!"
  106. else:
  107. message " {@prefix} &cIt looks like that you don't have permission!"
  108. else if arg 1 is "place":
  109. if player has permission "megacrates.admin":
  110. if arg 2 is set:
  111. if {Crate.%arg 2%} is set:
  112. set player's target block to {@crate-block}
  113. message " {@prefix} &eCrate was successfully set!"
  114. set {CrateLocation.%player's target block's location%} to "%arg 2%"
  115. else:
  116. message " {@prefix} &cThat crate doesn't exist!"
  117. else:
  118. message " {@prefix} &cYou didn't specify any crate!"
  119. else:
  120. message " {@prefix} &cIt looks like that you don't have permission!"
  121. else if arg 1 is "delete":
  122. if player has permission "megacrates.admin":
  123. if arg 2 is set:
  124. if {Crate.%arg 2%} is set:
  125. delete {CrateItem.%arg 2%}
  126. delete {Crate.%arg 2%}
  127. delete {CrateItemsTotal.%arg 2%}
  128. message " {@prefix} &eCrate &a%arg 2% &ewas successfully deleted!"
  129. else:
  130. message " {@prefix} &cThis crate doesn't exist!"
  131. else:
  132. message " {@prefix} &cYou didn't specify any crate!"
  133. else:
  134. message " {@prefix} &cIt looks like that you don't have permission!"
  135. else if arg 1 is "removeitem":
  136. if player has permission "megacrates.admin":
  137. if arg 2 is set:
  138. if {Crate.%arg 2%} is set:
  139. message " {@prefix} &eYou've successfully removed %{CrateItem.%arg 2%::%{CrateItemsTotal.%arg 2%}%}% from crate %arg 2%!"
  140. remove {CrateItem.%arg 2%::%{CrateItemsTotal.%arg 2%}%} from {CrateItem.%arg 2%::*}
  141. remove 1 from {CrateItemsTotal.%arg 2%}
  142. else:
  143. message " {@prefix} &cThat crate doesn't exist."
  144. else:
  145. message " {@prefix} &cYou didn't specify any crate!"
  146. else:
  147. message " {@prefix} &cIt looks like that you don't have permission!"
  148. else:
  149. message " {@prefix} &cCommand not found. /crate"
  150.  
  151. on load:
  152. set {update} to text from url "http://www.piskotuj.8u.cz/megacrates.txt"
  153. if {update} isn't "1.3":
  154. message " {@prefix} &eNew version is available!" to console
  155. message " &aDownload: &ehttp://bit.ly/1r3ykw2" to console
  156.  
  157. on join:
  158. if player has permission "megacrates.admin":
  159. set {update} to text from url "http://www.piskotuj.8u.cz/megacrates.txt"
  160. if {update} isn't "1.3":
  161. message " {@prefix} &eNew version is available!"
  162. message " &aDownload: &ehttp://bit.ly/1r3ykw2"
  163.  
  164. on rightclick on {@crate-block}:
  165. if {CrateLocation.%block's location%} is set:
  166. cancel event
  167. if player's tool is {@key-item} named "&c&l%{CrateLocation.%block's location%}% key":
  168. remove {@key-item} named "&c&l%{CrateLocation.%block's location%}% key" from player's inventory
  169. if {@animation} is false:
  170. loop 5 times:
  171. wait 0.1 second
  172. play mob spawner flames at target block
  173. play raw sound "note.bass" at player with pitch 5 volume 10
  174. wait 0.1 second
  175. play raw sound "note.bassattack" at player with pitch 5 volume 10
  176. wait 0.1 second
  177. play raw sound "note.harp" at player with pitch 5 volume 10
  178. wait 0.1 second
  179. play raw sound "note.pling" at player with pitch 5 volume 10
  180. wait 0.1 second
  181. play raw sound "note.snare" at player with pitch 5 volume 10
  182. set {random} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%block's location%}%}
  183. give {CrateItem.%{CrateLocation.%block's location%}%::%{random}%} to player
  184. if {@open-messages} is true:
  185. broadcast " {@prefix} &a%player% &ehas won &a%{CrateItem.%{CrateLocation.%block's location%}%::%{random}%}%&e!"
  186. else:
  187. stop
  188. play raw sound "random.successful_hit" at player with pitch 1 volume 10
  189. delete {random}
  190. else if {@animation} is true:
  191. open chest with 3 rows named "{@prefix}" to player
  192. cancel event
  193. if inventory name of player's current inventory is "{@prefix}":
  194. loop {@animation-length} times:
  195. play raw sound "note.pling" at player with pitch 1 volume 10
  196. play mob spawner flames at target block
  197. format slot 0 of player with 160:1 to be unstealable
  198. format slot 1 of player with 160:5 to be unstealable
  199. format slot 2 of player with 160:8 to be unstealable
  200. format slot 3 of player with 160:4 to be unstealable
  201. format slot 4 of player with 160:3 to be unstealable
  202. format slot 5 of player with 160:2 to be unstealable
  203. format slot 6 of player with 160:15 to be unstealable
  204. format slot 7 of player with 160:6 to be unstealable
  205. format slot 8 of player with 160:8 to be unstealable
  206. format slot 9 of player with 160:10 to be unstealable
  207. format slot 10 of player with 160:9 to be unstealable
  208. format slot 11 of player with 160:7 to be unstealable
  209. format slot 12 of player with 160:11 to be unstealable
  210. set {_randomprize.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%block's location%}%}
  211. format slot 13 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize}%} to be unstealable
  212. format slot 14 of player with 160:13 to be unstealable
  213. format slot 15 of player with 160:12 to be unstealable
  214. format slot 16 of player with 160:10 to be unstealable
  215. format slot 17 of player with 160:14 to be unstealable
  216. format slot 18 of player with 160:12 to be unstealable
  217. format slot 19 of player with 160:15 to be unstealable
  218. format slot 20 of player with 160:14 to be unstealable
  219. format slot 21 of player with 160:12 to be unstealable
  220. format slot 22 of player with 160:10 to be unstealable
  221. format slot 23 of player with 160:14 to be unstealable #160:1-15
  222. format slot 24 of player with 160:15 to be unstealable
  223. format slot 25 of player with 160:11 to be unstealable
  224. format slot 26 of player with 160:13 to be unstealable
  225. play raw sound "note.harp" at player with pitch 1 volume 10
  226. play mob spawner flames at target block
  227. wait 0.4 seconds
  228. format slot 0 of player with 160:4 to be unstealable
  229. format slot 1 of player with 160:3 to be unstealable
  230. format slot 2 of player with 160:6 to be unstealable
  231. format slot 3 of player with 160:8 to be unstealable
  232. format slot 4 of player with 160:5 to be unstealable
  233. format slot 5 of player with 160:2 to be unstealable
  234. format slot 6 of player with 160:1 to be unstealable
  235. format slot 7 of player with 160:7 to be unstealable
  236. format slot 8 of player with 160:6 to be unstealable
  237. format slot 9 of player with 160:9 to be unstealable
  238. format slot 10 of player with 160:5 to be unstealable
  239. format slot 11 of player with 160:8 to be unstealable
  240. format slot 12 of player with 160:4 to be unstealable
  241. set {_randomprize.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%block's location%}%}
  242. format slot 13 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize.%player%}%} to be unstealable
  243. format slot 14 of player with 160:11 to be unstealable
  244. format slot 15 of player with 160:14 to be unstealable
  245. format slot 16 of player with 160:13 to be unstealable
  246. format slot 17 of player with 160:12 to be unstealable
  247. format slot 18 of player with 160:15 to be unstealable
  248. format slot 19 of player with 160:10 to be unstealable
  249. format slot 20 of player with 160:11 to be unstealable
  250. format slot 21 of player with 160:14 to be unstealable
  251. format slot 22 of player with 160:13 to be unstealable
  252. format slot 23 of player with 160:12 to be unstealable #160:1-15
  253. format slot 24 of player with 160:10 to be unstealable
  254. format slot 25 of player with 160:11 to be unstealable
  255. format slot 26 of player with 160:15 to be unstealable
  256. play raw sound "note.pling" at player with pitch 1 volume 10
  257. play mob spawner flames at target block
  258. wait 0.3 second
  259. format slot 0 of player with 160:3 to be unstealable
  260. format slot 1 of player with 160:2 to be unstealable
  261. format slot 2 of player with 160:4 to be unstealable
  262. format slot 3 of player with 160:6 to be unstealable
  263. format slot 4 of player with 160:5 to be unstealable
  264. format slot 5 of player with 160:1 to be unstealable
  265. format slot 6 of player with 160:7 to be unstealable
  266. format slot 7 of player with 160:2 to be unstealable
  267. format slot 8 of player with 160:8 to be unstealable
  268. format slot 9 of player with 160:4 to be unstealable
  269. format slot 10 of player with 160:6 to be unstealable
  270. format slot 11 of player with 160:5 to be unstealable
  271. format slot 12 of player with 160:7 to be unstealable
  272. set {_randomprize.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%block's location%}%}
  273. format slot 13 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize.%player%}%} to be unstealable
  274. format slot 14 of player with 160:10 to be unstealable
  275. format slot 15 of player with 160:13 to be unstealable
  276. format slot 16 of player with 160:12 to be unstealable
  277. format slot 17 of player with 160:11 to be unstealable
  278. format slot 18 of player with 160:15 to be unstealable
  279. format slot 19 of player with 160:14 to be unstealable
  280. format slot 20 of player with 160:11 to be unstealable
  281. format slot 21 of player with 160:9 to be unstealable
  282. format slot 22 of player with 160:13 to be unstealable
  283. format slot 23 of player with 160:10 to be unstealable
  284. format slot 24 of player with 160:12 to be unstealable
  285. format slot 25 of player with 160:14 to be unstealable
  286. format slot 26 of player with 160:15 to be unstealable
  287. play raw sound "note.harp" at player with pitch 1 volume 10
  288. play mob spawner flames at target block
  289. wait 0.3 second
  290. set {random} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%block's location%}%}
  291. give {CrateItem.%{CrateLocation.%block's location%}%::%{random}%} to player
  292. wait 3 tick
  293. message "should open new inventory"
  294. set inventory name of player's current inventory to "test"
  295. clear player's current inventory
  296. if {@open-messages} is true:
  297. broadcast " {@prefix} &a%player% &ehas won &a%{CrateItem.%{CrateLocation.%block's location%}%::%{random}%}%&e!"
  298. else:
  299. stop
  300. play raw sound "random.successful_hit" at player with pitch 1 volume 10
  301. format slot 13 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{random}%} to close
  302. delete {random}
  303. else:
  304. message " {@prefix} &cYou don't have the right key!"
  305. if {@no-key-explosion} is true:
  306. push player backwards at speed 2
  307. play raw sound "random.explode" at player with pitch 5 volume 6
  308. else if {@no-key-explosion} is false:
  309. push player backwards at speed 0.9
  310. play raw sound "random.explode" at player with pitch 2 volume 3
  311.  
  312. on leftclick on {@crate-block}:
  313. if {CrateLocation.%block's location%} is set:
  314. open chest with 3 rows named "{@prefix} &ePrizes" to player
  315. set {item} to 0
  316. set {times} to 0
  317. loop {CrateItemsTotal.%{CrateLocation.%block's location%}%} times:
  318. add 1 to {item}
  319. set {chance} to 100/{CrateItemsTotal.%{CrateLocation.%block's location%}%}
  320. format slot {times} of player with {CrateItem.%{CrateLocation.%block's location%}%::%{item}%} named "&c%{CrateItem.%{CrateLocation.%block's location%}%::%{item}%}%" with lore "&eChance: &a%{chance}% %%" to close
  321. add 1 to {times}
  322.  
  323. on inventory close:
  324. If inventory name of player's current inventory is "{@prefix}":
  325. wait 1 tick
  326. open chest with 3 rows named "{@prefix}" to player
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement