Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- HP: &cHeist &8»&7
- N: &7
- command /heist [<text=help>] [<integer=4>] [<integer=999>] [<world>]:
- usage: /heist <gen/protect/help/coords/reset/start> <banks> [radius] [world]
- aliases: /hiest, /he
- trigger:
- if arg 1 is "help" or "h":
- player has permission "skript.op"
- send "{@HP} Argument usage:"
- 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 "+":
- send "{@HP} &8- {@N}%loop-value%"
- else if arg 1 is "reset" or "r":
- player has permission "skript.op"
- delete {heist::*}
- broadcast "{@HP} Heist was reset by %sender%."
- else if arg 1 is "coords" or "c":
- if {heist::*} is not set:
- message "{@HP} There are no banks"
- else:
- loop {heist::*}:
- send "{@HP} &8- ##&a%loop-index%{@N}: %loop-value%"
- else if arg 1 is "gen" or "generate":
- player has permission "skript.op"
- if arg 4 is not set:
- set {_w} to sender's world
- else:
- set {_w} to arg-4
- set {_ses} to new edit session in player's world with limit -1
- broadcast "{@HP} Generating '&a%arg 2%{@N}' banks in the world '&a%{_w}%{@N}' with a radius of '&a%arg 3%{@N}'."
- send "{@HP} &7&o(%sender%: Generating banks...)" to all ops
- loop arg 2 times:
- 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}))
- loop 255 times:
- if block at (location loop-number-2 below {_Location.GroundLevel}) is not air:
- set {_Location.GroundLevel} to (location (loop-number-2)+1 below ({_Location.GroundLevel}))
- if {heist::*} is set:
- set {_j} to (size of {heist::*})+1
- else:
- set {_j} to 1
- set {heist::%{_j}%} to {_Location.GroundLevel}
- broadcast "%{heist::%{_j}%}%"
- wait 1 second
- teleport command sender to {heist::%{_j}%}
- wait 2 ticks
- player command "/schem load rr_bank3"
- wait 2 ticks
- player command "//paste"
- broadcast "{@HP} Generated {@N}Bank '&a##%{_j}%'{@N} in world '&a%{_w}%{@N}'. &8[&a%(loop-number/arg 2)*100%%%&8]"
- wait 1 second
- broadcast "{@HP} Successfully generated the banks."
- else if arg 1 is "protect" or "p":
- player has permission "skript.op"
- if {temp::heist.pro} is not set:
- set {temp::heist.pro} to true
- broadcast "{@HP} Banks are now &aprotected{@N}."
- else:
- delete {temp::heist.pro}
- broadcast "{@HP} Banks are now &cunprotected{@N}."
- else if arg-1 is "on" or "enable" or "start":
- player has permission "skript.op"
- loop 9 times:
- loop {heist::*}:
- loop blocks in radius 40 around {heist::%loop-value-1%}:
- broadcast "%{heist::%loop-value-1%}%"
- loop-block is chest
- set {_hereischest} to the location at the loop-block
- set {_h} to (a random integer between 0.9 and 15.1)
- if {_h} is 1:
- set the inventory of the block at {_hereischest} to 8 gold ingots
- if {_h} is 2:
- set the inventory of the block at {_hereischest} to 12 gold ingots
- if {_h} is 3:
- set the inventory of the block at {_hereischest} to 1 golden apple
- if {_h} is 4:
- set the inventory of the block at {_hereischest} to 3 diamond
- if {_h} is 5:
- set the inventory of the block at {_hereischest} to 5 diamond
- if {_h} is 6:
- set the inventory of the block at {_hereischest} to 2 ender pearls
- if {_h} is 7:
- set the inventory of the block at {_hereischest} to 4 obsidian
- if {_h} is 8:
- set the inventory of the block at {_hereischest} to 1 anvil
- if {_h} is 9:
- set the inventory of the block at {_hereischest} to 1 enchantment table
- if {_h} is 10:
- set the inventory of the block at {_hereischest} to 16 TNT
- if {_h} is 11:
- set the inventory of the block at {_hereischest} to 2 creeper spawn egg
- if {_h} is 12:
- set the inventory of the block at {_hereischest} to 64 arrow
- if {_h} is 13:
- set the inventory of the block at {_hereischest} to 1 potion of:16424
- if {_h} is 14:
- set the inventory of the block at {_hereischest} to 1 potion of:16386
- if {_h} is 15:
- set the inventory of the block at {_hereischest} to 1 potion of:16426
- wait 5 ticks
- broadcast "{@HP} Banks refilled."
- wait 10 minutes
- broadcast "{@HP} Banks will no longer be refilled."
- else if arg-1 is "testfill":
- player has permission "skript.op"
- loop 9 times:
- set {_number} to (size of {heist::*})
- loop {_number} times:
- loop blocks in radius 10 around {heist::%loop-number-2%}:
- loop-block is chest
- broadcast "%{heist::%loop-number-2%}%"
- set {_hereischest} to the location at the loop-block
- set {_h} to (a random integer between 0.9 and 15.1)
- if {_h} is 1:
- set the inventory of the block at {_hereischest} to 8 gold ingots
- if {_h} is 2:
- set the inventory of the block at {_hereischest} to 12 gold ingots
- if {_h} is 3:
- set the inventory of the block at {_hereischest} to 1 golden apple
- if {_h} is 4:
- set the inventory of the block at {_hereischest} to 3 diamond
- if {_h} is 5:
- set the inventory of the block at {_hereischest} to 5 diamond
- if {_h} is 6:
- set the inventory of the block at {_hereischest} to 2 ender pearls
- if {_h} is 7:
- set the inventory of the block at {_hereischest} to 4 obsidian
- if {_h} is 8:
- set the inventory of the block at {_hereischest} to 1 anvil
- if {_h} is 9:
- set the inventory of the block at {_hereischest} to 1 enchantment table
- if {_h} is 10:
- set the inventory of the block at {_hereischest} to 16 TNT
- if {_h} is 11:
- set the inventory of the block at {_hereischest} to 2 creeper spawn egg
- if {_h} is 12:
- set the inventory of the block at {_hereischest} to 64 arrow
- if {_h} is 13:
- set the inventory of the block at {_hereischest} to 1 potion of:16424
- if {_h} is 14:
- set the inventory of the block at {_hereischest} to 1 potion of:16386
- if {_h} is 15:
- set the inventory of the block at {_hereischest} to 1 potion of:16426
- wait 5 ticks
- broadcast "{@HP} Banks refilled."
- wait 10 seconds
- broadcast "{@HP} Banks will no longer be refilled."
- on rightclick on chest:
- {scenario::heist} is true
- loop {heist::*}:
- rounded (x-coordinate of event-block) is equal to rounded (x-coordinate of loop-value)+1
- rounded (z-coordinate of event-block) is equal to rounded (z-coordinate of loop-value)+1
- if {temp::heist.pro} is true:
- message "Banks are currently protected"
- cancel event
- broadcast "{@HP} %player% is in a bank! &a%location of player%"
- stop loop
- on break of chest:
- {scenario::heist} is true
- loop {heist::*}:
- rounded (x-coordinate of event-block) is equal to rounded (x-coordinate of loop-value)+1
- rounded (z-coordinate of event-block) is equal to rounded (z-coordinate of loop-value)+1
- if {temp::heist.pro} is true:
- message "Banks are currently protected"
- cancel event
- broadcast "{@HP} %player% is in a bank! &a%location of player%"
- stop loop
- #on script unload:
- # delete {temp::*}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement