Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- P: &8[&7ChunkApoc&8]
- CC: &a
- HC: &6
- Tick.Delay: 25 ticks
- Correct.Usage: /chunk <radius> <world> <percent>
- Broadcast.Messages: false
- command /chunkapoc [<integer>] [<world>] [<integer>]:
- permission: skript.op
- trigger:
- if {ChunkApoc::Running} is true:
- if arg-1 is not set:
- delete {ChunkApoc::Running}
- stop trigger
- else:
- message "{@P}{@CC} {@Correct.Usage}"
- if arg-1 is less than 16:
- message "{@P}{@CC} You cannot run this with a radius less than 16!"
- stop trigger
- if arg-2 is not set:
- message "{@P}{@CC} {@Correct.Usage}"
- stop trigger
- if arg-2 is not set:
- message "{@P}{@CC} {@Correct.Usage}"
- loop 3 times:
- command "/chunkapoc-sound note.harp"
- wait 4 ticks
- broadcast "{@P}{@CC}&r&k----------------------------------"
- broadcast "{@P}{@HC} %command sender%{@CC}: {@HC}%arg-1%{@CC} in {@HC}%arg-2%!"
- broadcast "{@P}{@CC} Beginning ChunkApoc! There may be lag! Do not log out!"
- broadcast "{@P}{@HC} ChunkApoc Skript by Fleft"
- broadcast "{@P}{@CC}&r&k----------------------------------"
- set command sender's gamemode to creative
- set {ChunkApoc::Running} to true
- set {ChunkApoc::Radius} to arg-1
- set {ChunkApoc::World} to arg-2
- set {ChunkApoc::Percent} to arg-3
- set {ChunkApoc::Loop.1} to 0
- set {ChunkApoc::Loop.2} to 0
- set {ChunkApoc::Count} to 0
- set {ChunkApoc::Time} to 0
- set {ChunkApoc::Notify} to now
- wait 1 second
- set {_count} to 3
- loop ({ChunkApoc::Radius}*2) times:
- add 1 to {ChunkApoc::Loop.1}
- if {ChunkApoc::Loop.1} is equal to 15:
- set {ChunkApoc::Time} to rounded down ((loop-number-1)/{ChunkApoc::Radius})*50
- if {@Broadcast.Messages} is true:
- if {ChunkApoc::Notify} was more than 5 seconds ago:
- broadcast "{@P}{@CC} Progress: {@HC}%{ChunkApoc::Time}%%%"
- set {ChunkApoc::Notfy} to now
- command "/chunkapoc-sound note.harp"
- set {ChunkApoc::Loop.1} to 0
- wait 1 tick
- loop ({ChunkApoc::Radius}*2) times:
- {ChunkApoc::Running} is not set:
- delete {ChunkApoc::*}
- broadcast "{@P}{@HC} Cancelled!"
- command "/chunkapoc-sound random.break"
- wait 5 ticks
- stop trigger
- add 1 to {ChunkApoc::Loop.2}
- if {ChunkApoc::Loop.2} is equal to 16:
- set {ChunkApoc::Loop.2} to 0
- chance of {ChunkApoc::Percent}%:
- loop 256 times:
- set {ChunkApoc::x.coord} to ((loop-number-1)-{ChunkApoc::Radius})
- set {ChunkApoc::z.coord} to ((loop-number-2)-{ChunkApoc::Radius})
- set {ChunkApoc::Location} to (location at ({ChunkApoc::x.coord}, 255, {ChunkApoc::z.coord}) of the world ({ChunkApoc::World}))
- loop blocks from (block at (the location at ({ChunkApoc::x.coord}), (256-(loop-number-3)), ({ChunkApoc::z.coord}) of the world {ChunkApoc::World})) to (block at (the location at ({ChunkApoc::x.coord}), (256-(loop-number-3)), ({ChunkApoc::z.coord}-16) of the world {ChunkApoc::World})):
- loop blocks from loop-block-1 to (block 16 west of loop-block-1):
- set loop-block-2 to air
- #teleport command sender to (location 1 above {ChunkApoc::Location})
- add 1 to {ChunkApoc::Time}
- wait {@Tick.Delay}
- broadcast "{@P}{@CC} Finished"
- delete {ChunkApoc::*}
- set {ChunkApoc::Location} to (location at (0, 255, 0) of the world (world of command sender))
- while (block at {ChunkApoc::Location}) is air:
- set {ChunkApoc::Location} to location 1 below {ChunkApoc::Location}
- if y-coordinate of {ChunkApoc::Location} is less than 5:
- broadcast "{@P}{@CC} Error: Could not teleport {@HC}%command sender%{@CC} to 0,0."
- delete {ChunkApoc::Location}
- wait 1 tick
- loop 3 times:
- command "/chunkapoc-sound note.harp"
- wait 3 ticks
- broadcast "{@P}{@CC}&r&k----------------------------------"
- broadcast "{@P}{@CC} Automatically finishing chunkapoc using"
- broadcast "{@P}{@HC} WorldBorder!{@CC} May be small lag!"
- broadcast "{@P}{@CC}&r&k----------------------------------"
- execute console command "/chunkapoc-sound random.explode"
- command /chunkapoc-sound <text>:
- permission: skript.chunkapoc
- trigger:
- loop all players:
- execute console command "/playsound %arg% %loop-player% ~ ~ ~ 1 1 1"
- on physics:
- {ChunkApoc::Running} is true:
- cancel the event
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement