Advertisement
Guest User

Untitled

a guest
Nov 17th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.57 KB | None | 0 0
  1. command /crate [<integer>]:
  2. permission: *
  3. trigger:
  4. if arg-1 is set:
  5. if arg-1 is a integer:
  6. if arg-1 is between 1 and 4:
  7. if arg-1 is 1:
  8. give player 1 chest named "&aEmerald Crate"
  9. send "&aDu modtog en emerald crate!"
  10. else if arg-1 is 2:
  11. give player 1 chest named "&bDiamond Crate"
  12. send "&aDu modtog en diamond crate!"
  13. else if arg-1 is 3:
  14. give player 1 chest named "&eKing Crate"
  15. send "&aDu modtog en king crate!"
  16. else if arg-1 is 4:
  17. give player 1 chest named "&5Legend Crate"
  18. send "&aDu modtog en legend crate!"
  19. else:
  20. send "&7&m----------&b&lCrates&7&m----------"
  21. send " "
  22. send "&a1. Emerald Crate"
  23. send "&b2. Diamond Crate"
  24. send "&e3. King Crate"
  25. send "&54. Legend Crate"
  26. else:
  27. send "&cDet skal være et heltal!"
  28. else:
  29. send "&b/crate <integer>"
  30. send "&7&m----------&b&lCrates&7&m----------"
  31. send " "
  32. send "&a1. Emerald Crate"
  33. send "&b2. Diamond Crate"
  34. send "&e3. King Crate"
  35. send "&54. Legend Crate"
  36.  
  37.  
  38.  
  39.  
  40. on leftclick on a chest:
  41. # Preview på hvad du kan vinde
  42. if event-block contains {crates.emerald::*}:
  43. open chest with 3 rows named "&eEmerald Prizes" to player
  44. format slot 10 of player with paper named "&b100 kr" with lore "&7Chance: &b50%" to be unstealable
  45. format slot 11 of player with diamond sword named "&aEmerald Sword!" with lore "&7Chance: &b25%" to be unstealable
  46. format slot 12 of player with paper named "&b5000 kr" with lore "&7Chance: &b10%" to be unstealable
  47. format slot 13 of player with book named "&aEmerald Rank" with lore "&7Chance: &b5%" to be unstealable
  48. # Diamond, King osv..
  49.  
  50. on rightclick on a chest:
  51. # Handle Emerald Crate
  52. if event-block contains {crates.emerald::*}:
  53. if player is holding a trip wire hook named "&aEmerald Key":
  54. if player's inventory is not full:
  55. remove trip wire hook named "&aEmerald Key" from player's inventory
  56. open chest with 3 rows named "&aEmerald Crate" to player
  57. chance of 5%:
  58. format slot 13 of player with book named "&aEmerald Rank" to close
  59. give player 1 book named "&aEmerald Rank"
  60. send "&bDu vandt emerald rank!"
  61. stop
  62. chance of 10%:
  63. format slot 13 of player with paper named "&b5000 kr" to close
  64. add 5000 to player's balance
  65. send "&bDu vandt 5000 kr!"
  66. stop
  67. chance of 25%:
  68. format slot 13 of player with diamond sword named "&aEmerald Sword!" to close
  69. give player 1 diamond sword named "&aEmerald Sword"
  70. send "&bDu vandt et Diamond Sword!"
  71. stop
  72. # Dårligste ting kommer her.
  73. format slot 13 of player with paper named "&b100 kr" to close
  74. add 100 to player's balance
  75. send "&bDu vandt 100 kr!"
  76. else:
  77. send "&cDer er ikke nok plads i din inventory!"
  78. else:
  79. send "&cDu skal bruge en Emerald key for dette!"
  80. set {_knock} to random number between 0.1 and 0.4
  81. push player backwards at speed {_knock}
  82. if event-block contains {crates.diamond::*}:
  83. if player is holding a trip wire hook named "&bDiamond Key":
  84. if player's inventory is not full:
  85. remove trip wire hook named "&bDiamond Key" from player's inventory
  86. open chest with 3 rows named "&bDiamond Key" to player
  87. chance of 5%:
  88. format slot 13 of player with book named "&bDiamond Rank" to close
  89. give player 1 book named "&bDiamond Rank"
  90. send "&bDu vandt emerald rank!"
  91. stop
  92. chance of 10%:
  93. format slot 13 of player with paper named "&b5000 kr" to close
  94. add 5000 to player's balance
  95. send "&bDu vandt 5000 kr!"
  96. stop
  97. chance of 25%:
  98. format slot 13 of player with diamond sword named "&bDiamond Sword!" to close
  99. give player 1 diamond sword named "&bDiamond Sword"
  100. send "&bDu vandt et Diamond Sword!"
  101. stop
  102. # Dårligste ting kommer her.
  103. format slot 13 of player with paper named "&b50 kr" to close
  104. add 50 to player's balance
  105. send "&bDu vandt 50 kr!"
  106. else:
  107. send "&cDer er ikke nok plads i din inventory!"
  108. else:
  109. send "&cDu skal bruge en Diamond key for dette!"
  110. set {_knock} to random number between 0.1 and 0.4
  111. push player backwards at speed {_knock}
  112. if event-block contains {crates.king::*}:
  113. if player is holding a trip wire hook named "&eKing Key":
  114. if player's inventory is not full:
  115. remove trip wire hook named "&eKing Key" from player's inventory
  116. open chest with 3 rows named "&eKing Crate" to player
  117. chance of 5%:
  118. format slot 13 of player with book named "&eKing Rank" to close
  119. give player 1 book named "&eKing Rank"
  120. send "&bDu vandt king rank!"
  121. stop
  122. chance of 10%:
  123. format slot 13 of player with paper named "&b5000 kr" to close
  124. add 5000 to player's balance
  125. send "&bDu vandt 5000 kr!"
  126. stop
  127. chance of 25%:
  128. format slot 13 of player with diamond sword named "&eKing Sword!" to close
  129. give player 1 diamond sword named "&eKing Sword"
  130. send "&bDu vandt et Diamond Sword!"
  131. stop
  132. # Dårligste ting kommer her.
  133. format slot 13 of player with paper named "&b100 kr" to close
  134. add 100 to player's balance
  135. send "&bDu vandt 100 kr!"
  136. else:
  137. send "&cDer er ikke nok plads i din inventory!"
  138. else:
  139. send "&cDu skal bruge en King key for dette!"
  140. set {_knock} to random number between 0.1 and 0.4
  141. push player backwards at speed {_knock}
  142. if event-block contains {crates.legend::*}:
  143. if player is holding a trip wire hook named "&5Legend Key":
  144. if player's inventory is not full:
  145. remove trip wire hook named "&5Legend Key" from player's inventory
  146. open chest with 3 rows named "&5Legend Crate" to player
  147. chance of 5%:
  148. format slot 13 of player with book named "&5Legend Rank" to close
  149. give player 1 book named "&eLegend Rank"
  150. send "&bDu vandt legend rank!"
  151. stop
  152. chance of 10%:
  153. format slot 13 of player with paper named "&b5000 kr" to close
  154. add 5000 to player's balance
  155. send "&bDu vandt 5000 kr!"
  156. stop
  157. chance of 25%:
  158. format slot 13 of player with diamond sword named "&bDiamond Sword!" to close
  159. give player 1 diamond sword named "&bDiamond Sword"
  160. send "&bDu vandt et Diamond Sword!"
  161. stop
  162. # Dårligste ting kommer her.
  163. format slot 13 of player with paper named "&b50 kr" to close
  164. add 50 to player's balance
  165. send "&bDu vandt 50 kr!"
  166. else:
  167. send "&cDer er ikke nok plads i din inventory!"
  168. else:
  169. send "&cDu skal bruge en Legend key for dette!"
  170. set {_knock} to random number between 0.1 and 0.4
  171. push player backwards at speed {_knock}
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179. on block place:
  180. if player is holding a chest named "&aEmerald Crate":
  181. if player has permission "crate.place.emerald":
  182. add event-block to {crates.emerald::*}
  183. send "&bDu placerede en Emerald Crate!"
  184. else:
  185. send "&cDu har ikke adgang til dette!"
  186. else if player is holding a chest named "&bDiamond Crate":
  187. if player has permission "crate.place.diamond":
  188. add event-block to {crates.diamond::*}
  189. send "&bDu placerede en Diamond Crate!"
  190. else:
  191. send "&cDu har ikke adgang til dette!"
  192. else if player is holding a chest named "&eKing Crate":
  193. if player has permission "crate.place.king":
  194. add event-block to {crates.king::*}
  195. send "&bDu placerede en King Crate!"
  196. else:
  197. send "&cDu har ikke adgang til dette!"
  198. else if player is holding a chest named "&5Legend Crate":
  199. if player has permission "crate.place.legend":
  200. add event-block to {crates.legend::*}
  201. send "&bDu placerede en Legend Crate!"
  202. else:
  203. send "&cDu har ikke adgang til dette!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement