Advertisement
Guest User

Untitled

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