Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.74 KB | None | 0 0
  1. options:
  2. pref: &dCRATES &8•
  3.  
  4. on right click on white shulker box:
  5. cancel event
  6. if player's held item is tripwire hook named "&fCOMMON KEY" with lore " ", "&eOpen at Spawn.", and " ":
  7. cancel event
  8. set {_itemWon} to random element out of {crate.common::*}
  9. remove 1 of player's held item from player's inventory
  10. play "block_ender_chest_open" to player at volume 10 and pitch 1
  11. make event-block appear open for all players
  12. give {_itemWon} to player
  13. play "entity_ender_dragon_growl" to player at volume 10 and pitch 0
  14. wait 1 second
  15. make event-block appear closed for all players
  16. else:
  17. push the player upwards at speed 1
  18. push the player backwards at speed 1
  19.  
  20. command /crate [<text>] [<text>] [<player>]:
  21. permission: crates.*
  22. trigger:
  23. if arg-1 is not set:
  24. send " "
  25. send "&d&l• &d/add <name> &8: &7&oCreates a new crate."
  26. send "&d&l• &d/crate add <name> &8: &7&oAdds held item to crate rewards."
  27. send "&d&l• &d/crate key <name> <player> &8: &7&oGives a crate key to a player."
  28. send "&d&l• &d/crate keyall <name> &8: &7&oGives everyone a crate key."
  29. send "&d&l• &d/crate delete <name> &8: &7&oDeletes a crate."
  30. send "&d&l• &d/crate list <name> &8: &7&oShows all items in the crate's rewards."
  31. send "&d&l• &d/crate clear <name> &8: &7&oClears all items from a crate's rewards."
  32. send " "
  33. if arg-1 is "add":
  34. if arg-2 is set:
  35. if arg-3 is not set:
  36. loop {crates::*}:
  37. if {crates::*} contains arg-2:
  38. add player's held item to {crate.%arg-2%::*}
  39. send "{@pref} &7You added your held item to the rewards for the &d%arg-2% &7crate!"
  40. else if {crates::*} doesn't contain arg-2:
  41. send "{@pref} &7That crate doesn't exist!"
  42. else if arg-3 is set:
  43. send "{@pref} &7/crate add <name>"
  44. else if arg-2 is not set:
  45. send "{@pref} &7/crate add <name>"
  46. if arg-1 is "key":
  47. if arg-2 is set:
  48. if arg-3 is set:
  49. loop {crates::*}:
  50. if {crates::*} contains arg-2:
  51. if arg-2 is "common":
  52. give arg-3 1 tripwire hook named "&fCOMMON KEY" with lore " ", "&eOpen at Spawn.", and " "
  53. send "{@pref} &7You gave a &fCOMMON &7crate key to &d%arg-3%&d!" to player
  54. send "{@pref} &7You have been given a &fCOMMON &7crate key!" to arg-3
  55. else if {crates::*} doesn't contain arg-2:
  56. send "{@pref} &7That crate doesn't exist!"
  57. else if arg-3 is not set:
  58. send "{@pref} &7/crate key <name> <player>"
  59. else if arg-2 is not set:
  60. send "{@pref} &7/crate key <name> <player>"
  61. if arg-1 is "keyall":
  62. if arg-2 is set:
  63. if arg-3 is not set:
  64. loop {crates::*}:
  65. if {crates::*} contains arg-2:
  66. if arg-2 is "common":
  67. loop all players:
  68. give loop-player 1 tripwire hook named "&fCOMMON KEY" with lore " ", "&eOpen at Spawn.", and " "
  69. send "{@pref} &7You gave everyone a &fCOMMON &7crate key." to player
  70. broadcast "{@pref} &7You have been given a &fCOMMON &7crate key."
  71. else if {crates::*} doesn't contain arg-2:
  72. send "{@pref} &7That crate doesn't exist!"
  73. else if arg-3 is set:
  74. send "{@pref} &7/crate keyall <name>"
  75. else if arg-2 is not set:
  76. send "{@pref} &7/crate keyall <name>"
  77. if arg-1 is "delete":
  78. if arg-2 is set:
  79. if arg-3 is not set:
  80. loop {crates::*}:
  81. if {crates::*} contains arg-2:
  82. delete {crate.%arg-2%::*}
  83. remove arg-2 from {crates::*}
  84. send "{@pref} &7Deleted &d%arg-2% &7crate!"
  85. else if {crates::*} doesn't contain arg-2:
  86. send "{@pref} &7That crate doesn't exist!"
  87. else if arg-3 is set:
  88. send "{@pref} &7/crate delete <name>"
  89. else if arg-2 is not set:
  90. send "{@pref} &7/crate delete <name>"
  91. if arg-1 is "list":
  92. if arg-2 is set:
  93. if arg-3 is not set:
  94. loop {crates::*}:
  95. if {crates::*} contains arg-2:
  96. open virtual chest inventory with size 3 named "&b%arg-2%&b's Rewards:" to player
  97. set {_n} to 0
  98. loop {crate.%arg-2%::*}:
  99. set {_i} to loop-value-2
  100. format gui slot {_n} of player with {_i} to close
  101. add 1 to {_n}
  102. else if {crates::*} doesn't contain arg-2:
  103. send "{@pref} &7That crate doesn't exist!"
  104. else if arg-3 is set:
  105. send "{@pref} &7/crate list <name>"
  106. else if arg-2 is not set:
  107. send "{@pref} &7/crate list <name>"
  108. if arg-1 is "clear":
  109. if arg-2 is set:
  110. if arg-3 is not set:
  111. loop {crates::*}:
  112. if {crates::*} contains arg-2:
  113. send "{@pref} &7Cleared items for &d%arg-2% &7crate!"
  114. delete {crate.%arg-2%::*}
  115. else if {crates::*} doesn't contain arg-2:
  116. send "{@pref} &7That crate doesn't exist!"
  117. else if arg-3 is set:
  118. send "{@pref} &7/crate clear <name>"
  119. else if arg-2 is not set:
  120. send "{@pref} &7/crate clear <name>"
  121.  
  122. command /add [<text>]:
  123. permission: crates.*
  124. trigger:
  125. if arg-1 is not set:
  126. send "{@pref} &7/add <name>"
  127. else if arg-1 is set:
  128. loop {crates::*}:
  129. if {crates::*} contains arg-1:
  130. send "{@pref} &7That crate already exists!"
  131. else:
  132. add arg-1 to {crates::*}
  133. send "{@pref} &7You added &d%arg-1% &7to crates!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement