Advertisement
Guest User

Untitled

a guest
Oct 20th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.35 KB | None | 0 0
  1. options:
  2. HP: &cHeist &8»&7
  3. N: &7
  4.  
  5. command /heist [<text=help>] [<integer=4>] [<integer=999>] [<world>]:
  6. usage: /heist <gen/protect/help/coords/reset/start> <banks> [radius] [world]
  7. aliases: /hiest, /he
  8. trigger:
  9.  
  10. if arg 1 is "help" or "h":
  11. player has permission "skript.op"
  12. send "{@HP} Argument usage:"
  13. loop split "&a<generate> <banks> <radius> <world> &7&o(EG: /heist gen 4 999 rr_world)+&a<protect> &7&o(Toggles bank protection.)+&a<coords> &7&o(Sends coords of banks [world specific])+&a<reset&a> &7&o(Resets variables)" at "+":
  14. send "{@HP} &8- {@N}%loop-value%"
  15.  
  16. else if arg 1 is "reset" or "r":
  17. player has permission "skript.op"
  18. delete {heist::*}
  19. broadcast "{@HP} Heist was reset by %sender%."
  20.  
  21. else if arg 1 is "coords" or "c":
  22. if {heist::*} is not set:
  23. message "{@HP} There are no banks"
  24. else:
  25. loop {heist::*}:
  26. send "{@HP} &8- ##&a%loop-index%{@N}: %loop-value%"
  27.  
  28. else if arg 1 is "gen" or "generate":
  29. player has permission "skript.op"
  30. if arg 4 is not set:
  31. set {_w} to sender's world
  32. else:
  33. set {_w} to arg-4
  34. set {_ses} to new edit session in player's world with limit -1
  35. broadcast "{@HP} Generating '&a%arg 2%{@N}' banks in the world '&a%{_w}%{@N}' with a radius of '&a%arg 3%{@N}'."
  36. send "{@HP} &7&o(%sender%: Generating banks...)" to all ops
  37. loop arg 2 times:
  38. set {_Location.GroundLevel} to (the location at (random integer between (0-(arg 3)) and (0+(arg 3))), 255, (random integer between (0-(arg 3)) and (0+(arg 3))) of the world ({_w}))
  39. loop 255 times:
  40. if block at (location loop-number-2 below {_Location.GroundLevel}) is not air:
  41. set {_Location.GroundLevel} to (location (loop-number-2)+1 below ({_Location.GroundLevel}))
  42.  
  43. if {heist::*} is set:
  44. set {_j} to (size of {heist::*})+1
  45. else:
  46. set {_j} to 1
  47. set {heist::%{_j}%} to {_Location.GroundLevel}
  48.  
  49. broadcast "%{heist::%{_j}%}%"
  50.  
  51. wait 1 second
  52. teleport command sender to {heist::%{_j}%}
  53. wait 2 ticks
  54. player command "/schem load rr_bank3"
  55. wait 2 ticks
  56. player command "//paste"
  57. broadcast "{@HP} Generated {@N}Bank '&a##%{_j}%'{@N} in world '&a%{_w}%{@N}'. &8[&a%(loop-number/arg 2)*100%%%&8]"
  58. wait 1 second
  59. broadcast "{@HP} Successfully generated the banks."
  60.  
  61. else if arg 1 is "protect" or "p":
  62. player has permission "skript.op"
  63. if {temp::heist.pro} is not set:
  64. set {temp::heist.pro} to true
  65. broadcast "{@HP} Banks are now &aprotected{@N}."
  66. else:
  67. delete {temp::heist.pro}
  68. broadcast "{@HP} Banks are now &cunprotected{@N}."
  69.  
  70. else if arg-1 is "on" or "enable" or "start":
  71. player has permission "skript.op"
  72. loop 9 times:
  73. loop {heist::*}:
  74. loop blocks in radius 40 around {heist::%loop-value-1%}:
  75.  
  76. broadcast "%{heist::%loop-value-1%}%"
  77.  
  78. loop-block is chest
  79. set {_hereischest} to the location at the loop-block
  80. set {_h} to (a random integer between 0.9 and 15.1)
  81. if {_h} is 1:
  82. set the inventory of the block at {_hereischest} to 8 gold ingots
  83. if {_h} is 2:
  84. set the inventory of the block at {_hereischest} to 12 gold ingots
  85. if {_h} is 3:
  86. set the inventory of the block at {_hereischest} to 1 golden apple
  87. if {_h} is 4:
  88. set the inventory of the block at {_hereischest} to 3 diamond
  89. if {_h} is 5:
  90. set the inventory of the block at {_hereischest} to 5 diamond
  91. if {_h} is 6:
  92. set the inventory of the block at {_hereischest} to 2 ender pearls
  93. if {_h} is 7:
  94. set the inventory of the block at {_hereischest} to 4 obsidian
  95. if {_h} is 8:
  96. set the inventory of the block at {_hereischest} to 1 anvil
  97. if {_h} is 9:
  98. set the inventory of the block at {_hereischest} to 1 enchantment table
  99. if {_h} is 10:
  100. set the inventory of the block at {_hereischest} to 16 TNT
  101. if {_h} is 11:
  102. set the inventory of the block at {_hereischest} to 2 creeper spawn egg
  103. if {_h} is 12:
  104. set the inventory of the block at {_hereischest} to 64 arrow
  105. if {_h} is 13:
  106. set the inventory of the block at {_hereischest} to 1 potion of:16424
  107. if {_h} is 14:
  108. set the inventory of the block at {_hereischest} to 1 potion of:16386
  109. if {_h} is 15:
  110. set the inventory of the block at {_hereischest} to 1 potion of:16426
  111. wait 5 ticks
  112. broadcast "{@HP} Banks refilled."
  113. wait 10 minutes
  114. broadcast "{@HP} Banks will no longer be refilled."
  115.  
  116.  
  117. else if arg-1 is "testfill":
  118. player has permission "skript.op"
  119. loop 9 times:
  120. set {_number} to (size of {heist::*})
  121. loop {_number} times:
  122. loop blocks in radius 10 around {heist::%loop-number-2%}:
  123. loop-block is chest
  124.  
  125. broadcast "%{heist::%loop-number-2%}%"
  126.  
  127. set {_hereischest} to the location at the loop-block
  128. set {_h} to (a random integer between 0.9 and 15.1)
  129. if {_h} is 1:
  130. set the inventory of the block at {_hereischest} to 8 gold ingots
  131. if {_h} is 2:
  132. set the inventory of the block at {_hereischest} to 12 gold ingots
  133. if {_h} is 3:
  134. set the inventory of the block at {_hereischest} to 1 golden apple
  135. if {_h} is 4:
  136. set the inventory of the block at {_hereischest} to 3 diamond
  137. if {_h} is 5:
  138. set the inventory of the block at {_hereischest} to 5 diamond
  139. if {_h} is 6:
  140. set the inventory of the block at {_hereischest} to 2 ender pearls
  141. if {_h} is 7:
  142. set the inventory of the block at {_hereischest} to 4 obsidian
  143. if {_h} is 8:
  144. set the inventory of the block at {_hereischest} to 1 anvil
  145. if {_h} is 9:
  146. set the inventory of the block at {_hereischest} to 1 enchantment table
  147. if {_h} is 10:
  148. set the inventory of the block at {_hereischest} to 16 TNT
  149. if {_h} is 11:
  150. set the inventory of the block at {_hereischest} to 2 creeper spawn egg
  151. if {_h} is 12:
  152. set the inventory of the block at {_hereischest} to 64 arrow
  153. if {_h} is 13:
  154. set the inventory of the block at {_hereischest} to 1 potion of:16424
  155. if {_h} is 14:
  156. set the inventory of the block at {_hereischest} to 1 potion of:16386
  157. if {_h} is 15:
  158. set the inventory of the block at {_hereischest} to 1 potion of:16426
  159. wait 5 ticks
  160. broadcast "{@HP} Banks refilled."
  161. wait 10 seconds
  162. broadcast "{@HP} Banks will no longer be refilled."
  163.  
  164.  
  165. on rightclick on chest:
  166. {scenario::heist} is true
  167. loop {heist::*}:
  168. rounded (x-coordinate of event-block) is equal to rounded (x-coordinate of loop-value)+1
  169. rounded (z-coordinate of event-block) is equal to rounded (z-coordinate of loop-value)+1
  170. if {temp::heist.pro} is true:
  171. message "Banks are currently protected"
  172. cancel event
  173. broadcast "{@HP} %player% is in a bank! &a%location of player%"
  174. stop loop
  175.  
  176. on break of chest:
  177. {scenario::heist} is true
  178. loop {heist::*}:
  179. rounded (x-coordinate of event-block) is equal to rounded (x-coordinate of loop-value)+1
  180. rounded (z-coordinate of event-block) is equal to rounded (z-coordinate of loop-value)+1
  181. if {temp::heist.pro} is true:
  182. message "Banks are currently protected"
  183. cancel event
  184. broadcast "{@HP} %player% is in a bank! &a%location of player%"
  185. stop loop
  186.  
  187. #on script unload:
  188. # delete {temp::*}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement