kjfalkeiae

Untitled

Apr 14th, 2019
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.10 KB | None | 0 0
  1. #Pattern 1/2
  2. command /chestrandom1:
  3. trigger:
  4. if sender does not have permission "skript.admin":
  5. send "&cYou do not have permission to do this."
  6. send "&cPlease contact the server administrators."
  7. stop
  8. if amount of {chests1::*} is 0:
  9. send "&cPlease select the chest."
  10. stop
  11. loop {chests1::*}:
  12. set {_slot} to random integer between 0 and 27
  13. set {_items} to random integer between 5 and 10
  14. set {_chest} to loop-value
  15. loop {_items} count:
  16. set {_item} to random integer between 1 and 3
  17. if {_item} is 1:
  18. set slot {_slot} of {_chest} to 32 arrow
  19. if {_item} is 2:
  20. set slot {_slot} of {_chest} to 64 oak wood
  21. if {_item} is 3:
  22. set slot {_slot} of {_chest} to 64 stone
  23.  
  24. command /chestselect1 [<text>]:
  25. trigger:
  26. if player does not have permission "skript.admin":
  27. send "&cYou don't have permission, or you are not a player."
  28. stop
  29. if arg 1 is not set:
  30. send "&cUsage:/chestselect1 <add|remove|reset|stop>"
  31. stop
  32. if arg 1 is "add":
  33. set {chestmode1.%player%} to "add"
  34. send "&bBreak the chest."
  35. stop
  36. if arg 1 is "remove":
  37. set {chestmode1.%player%} to "remove"
  38. send "&bBreak the chest."
  39. stop
  40. if arg 1 is "reset":
  41. clear {chests1::*}
  42. send "&bAll chests was removed!"
  43. stop
  44. if arg 1 is "stop":
  45. delete {chestmode1.%player%}
  46. send "&bChest selection mode was stopped."
  47. stop
  48.  
  49. on break:
  50. if {chestmode1.%player%} is "add":
  51. cancel event
  52. if {chests1::*} contains event-block:
  53. send "&cThis chest already added."
  54. stop
  55. if event-block is not chest:
  56. send "&cThis block is not a chest."
  57. stop
  58. add event-block to {chests1::*}
  59. send "&bAdd the chest successfly."
  60. stop
  61. if {chestmode1.%player%} is "remove":
  62. cancel event
  63. if {chests1::*} does not contain event-block:
  64. send "&cThis chest does not contain randomize chest list."
  65. stop
  66. if event-block is not chest:
  67. send "&cThis block is not a chest."
  68. stop
  69. remove event-block to {chests1::*}
  70. send "&bRemove the chest successfly."
  71.  
  72. #Pattern 2/2
  73. command /chestrandom2:
  74. trigger:
  75. if sender does not have permission "skript.admin":
  76. send "&cYou do not have permission to do this."
  77. send "&cPlease contact the server administrators."
  78. stop
  79. if amount of {chests2::*} is 0:
  80. send "&cPlease select the chest."
  81. stop
  82. loop {chests2::*}:
  83. set {_slot} to random integer between 0 and 27
  84. set {_items} to random integer between 5 and 20
  85. set {_chest} to loop-value
  86. loop {_items} count:
  87. set {_item} to random integer between 2 and 3
  88. if {_item} is 1:
  89. set slot {_slot} of {_chest} to 32 diamond
  90. if {_item} is 2:
  91. set slot {_slot} of {_chest} to 64 iron ingot
  92. if {_item} is 3:
  93. set slot {_slot} of {_chest} to 64 white wool
  94.  
  95. command /chestselect2 [<text>]:
  96. trigger:
  97. if player does not have permission "skript.admin":
  98. send "&cYou don't have permission, or you are not a player."
  99. stop
  100. if arg 1 is not set:
  101. send "&cUsage:/chestselect2 <add|remove|reset|stop>"
  102. stop
  103. if arg 1 is "add":
  104. set {chestmode2.%player%} to "add"
  105. send "&bBreak the chest."
  106. stop
  107. if arg 1 is "remove":
  108. set {chestmode2.%player%} to "remove"
  109. send "&bBreak the chest."
  110. stop
  111. if arg 1 is "reset":
  112. clear {chests2::*}
  113. send "&bAll chests was removed!"
  114. stop
  115. if arg 1 is "stop":
  116. delete {chestmode2.%player%}
  117. send "&bChest selection mode was stopped."
  118. stop
  119.  
  120. on break:
  121. if {chestmode2.%player%} is "add":
  122. cancel event
  123. if {chests2::*} contains event-block:
  124. send "&cThis chest already added."
  125. stop
  126. if event-block is not chest:
  127. send "&cThis block is not a chest."
  128. stop
  129. add event-block to {chests2::*}
  130. send "&bAdd the chest successfly."
  131. stop
  132. if {chestmode2.%player%} is "remove":
  133. cancel event
  134. if {chests2::*} does not contain event-block:
  135. send "&cThis chest does not contain randomize chest list."
  136. stop
  137. if event-block is not chest:
  138. send "&cThis block is not a chest."
  139. stop
  140. remove event-block to {chests2::*}
  141. send "&bRemove the chest successfly."
Advertisement
Add Comment
Please, Sign In to add comment