Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- P: &8[&5Voidscape&8]&r
- on physics:
- {vs.running} is true
- cancel event
- command /voidscape <integer> <world>:
- permission: skript.op
- usage: "/voidscape <radius> <world>"
- trigger:
- if {vs.running} is true:
- message "{@P} Already running: %{vs.radius}% radius in ""%{vs.world}%""!"
- message "{@P} Finish that one with /vs-resume if it's paused, or cancel it with /vs-cancel!"
- set {vs.world} to arg 2
- if arg 1 is greater than 0:
- set {vs.radius} to arg 1
- else:
- message "{@P} That radius is not valid!"
- stop trigger
- set {vs.running} to true
- set {vs.paused} to false
- set {vs.slice} to 0
- set {vs.totalslice} to 0
- if {vs.radius} is less than 250:
- set {vs.buffer} to 8
- else if {vs.radius} is less than 500:
- set {vs.buffer} to 4
- else if {vs.radius} is less than 1000:
- set {vs.buffer} to 2
- else:
- set {vs.buffer} to 1
- broadcast "{@P} Starting setup in &b%{vs.world}%&r with radius &b%{vs.radius}%!"
- broadcast "{@P} Prepare for a LOT of lag!"
- loop blocks from the block at (the location at {vs.radius}, 0, {vs.radius} of the world {vs.world}) to the block at (the location at {vs.radius}, 0, (-1*{vs.radius}) of the world {vs.world}):
- loop blocks from (loop-block-1) to (the block (2*{vs.radius}+1) meters west of loop-block-1):
- while {vs.paused} is true:
- if {vs.stop} is set:
- delete {vs.stop}
- delete {vs.running}
- delete {vs.radius}
- delete {vs.paused}
- delete {vs.slice}
- delete {vs.totalslice}
- delete {vs.world}
- delete {vs.buffer}
- broadcast "{@P} Canceled!"
- stop trigger
- wait 1 tick
- loop blocks from (loop-block-2) to (the block 255 meters above loop-block-2):
- if loop-block-3 is stone:
- set loop-block-3 to air
- else if loop-block-3 is bedrock:
- set loop-block-3 to air
- else if loop-block-3 is gravel:
- if the block below loop-block-3 is air:
- set loop-block-3 to air
- add 1 to {vs.slice}
- if {vs.slice} is equal to {vs.buffer}:
- add {vs.slice} to {vs.totalslice}
- set {vs.slice} to 0
- broadcast "{@P} Progress: &b%({vs.totalslice}*100)/({vs.radius}*2+1)%%%"
- wait 1 second
- broadcast "{@P} Finished Voidscape in world"
- broadcast "{@P} &b%{vs.world}% with radius &b%{vs.radius}%!"
- delete {vs.running}
- delete {vs.radius}
- delete {vs.paused}
- delete {vs.slice}
- delete {vs.totalslice}
- delete {vs.world}
- delete {vs.buffer}
- command /vs-pause:
- permission: skript.op
- trigger:
- if {vs.running} is not set:
- message "{@P} None in progress!"
- else if {vs.paused} is true:
- message "{@P} Already paused!"
- else:
- broadcast "{@P} Paused! Use &b/vs-resume&r to resume!"
- set {vs.paused} to true
- command /vs-cancel:
- permission: skript.op
- trigger:
- if {vs.running} is not set:
- message "{@P} None to cancel!"
- else if {vs.paused} is true:
- set {vs.stop} to true
- broadcast "{@P} Canceled in world"
- broadcast "{@P} &b%{vs.world}%&r with radius &b%{vs.radius}%!"
- else:
- message "{@P} Pause first with &b/vs-pause!"
- command /vs-resume:
- permission: skript.op
- trigger:
- if {vs.running} is not set:
- message "{@P} None paused!"
- else if {vs.paused} is false:
- message "{@P} Already in progress!"
- else:
- broadcast "{@P} Progress resumed! &b/vs-pause&r to pause again!"
- set {vs.paused} to false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement