Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- P: &8[&dChunkApoc&8] #= Prefix =#
- CC: &r #= Main Chat Color =#
- HC: &b #= Highlight Color =#
- Correct.Usage: /ChunkApoc &b<radius> <world> #= How to not be dumb =#
- ChunkApoc.TP.Delay: 5 tick #= Don't change this =#
- Broadcast.Messages: true #= Broadcast Progress =#
- Coords.Spam.Chat: true #= Spams chat with every coordinate =#
- command /ChunkApoc [<integer>] [<world>] <integer>:
- permission: skript.op
- trigger:
- #= Arguments =#
- if {ChunkApoc::Running} is true:
- if arg-1 is not set:
- delete {ChunkApoc::Running}
- stop trigger
- else if arg-1 is set:
- message "{@P}{@HC} To cancel, use /ChunkApoc"
- stop trigger
- if arg-2 is not set:
- message "{@P}{@CC} {@Correct.Usage}"
- stop trigger
- loop 3 times:
- command "/ChunkApoc-sound note.harp"
- wait 3 ticks
- #= TP to 0,0 =#
- set {ChunkApoc::Location} to (location at (0, 255, 0) of the world (arg-2))
- 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 3:
- message "{@P}{@CC} Error: Could not teleport {@HC}%command sender%{@CC} to 0,0."
- teleport command sender to (location 1 above {ChunkApoc::Location})
- #= Variables + Gamemode Creative =#
- 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.5
- set {ChunkApoc::Loop.2} to 0.5
- set {ChunkApoc::Count} to 0
- set {ChunkApoc::Time} to 0
- set {ChunkApoc::Notify} to now
- #= Broadcast =#
- loop 6 times:
- message "{@P}{@CC} Remove your world border!"
- wait 2 ticks
- broadcast "&a&k--------------{@P}&a&k--------------"
- broadcast "&a&k--{@CC} %command sender%: {@HC}%arg-1%{@CC} in {@HC}%arg-2%!"
- broadcast "&a&k--{@CC} Beginning ChunkApoc! Do not log out!"
- if command sender is "Fleft":
- broadcast "&a&k--{@CC} ChunkApoc Skript by {@HC}You"
- else:
- broadcast "&a&k--{@CC} ChunkApoc Skript by {@HC}Fleft"
- broadcast "&a&k--{@CC} Use /skChunkApoc to cancel at any time!"
- broadcast "&a&k--------------{@P}&a&k--------------"
- wait 1 second
- set {_count} to 3
- loop 3 times:
- broadcast "{@P}{@CC} Starting:{@HC} %{_count}%..."
- command "/ChunkApoc-sound note.harp"
- subtract 1 from {_count}
- wait 1 second
- command sender command "/wb %arg-2% clear"
- #= Literally the ChunkApoc =#
- loop ({ChunkApoc::Radius}*2) times:
- add 1 to {ChunkApoc::Loop.1}
- if {ChunkApoc::Loop.1} is equal to 16.5:
- set {ChunkApoc::Time} to rounded down ((((loop-number-1)/{ChunkApoc::Radius})*50)-1)
- if {ChunkApoc::Notify} was more than 5 seconds ago:
- set {ChunkApoc::Notfy} to now
- if {@Broadcast.Messages} is true:
- broadcast "{@P}{@CC} Progress: {@HC}%{ChunkApoc::Time}%%%"
- else:
- message "{@P}{@CC} Progress: {@HC}%{ChunkApoc::Time}%%%"
- set {ChunkApoc::Loop.1} to 0.5
- loop ({ChunkApoc::Radius}*2) times:
- {ChunkApoc::Running} is not set:
- delete {ChunkApoc::*}
- broadcast "{@P}{@HC} Cancelled!"
- command "/ChunkApoc-sound random.break"
- wait 5 ticks
- 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 3:
- message "{@P}{@CC} Error: Could not teleport {@HC}%command sender%{@CC} to 0,0."
- wait 1 tick
- teleport command sender to (location 1 above {ChunkApoc::Location})
- message "{@P}{@CC} You were TPed to {@HC}0,%y-coordinate of command sender%,0!"
- delete {ChunkApoc::Location}
- stop trigger
- add 1 to {ChunkApoc::Loop.2}
- if {ChunkApoc::Loop.2} is equal to 16.5:
- set {ChunkApoc::Loop.2} to 0.5
- set {ChunkApoc::x.coord} to ((loop-number-1)-{ChunkApoc::Radius}+0.5)
- set {ChunkApoc::z.coord} to ((loop-number-2)-{ChunkApoc::Radius}+0.5)
- set {ChunkApoc::Location} to (location at ({ChunkApoc::x.coord}, 255, {ChunkApoc::z.coord}) of the world ({ChunkApoc::World}))
- 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 3:
- message "{@P}{@CC} Error: Void: Skipping location"
- delete {ChunkApoc::Location}
- if command sender is not online:
- broadcast "{@P}{@CC} ChunkApoc interrupted. {@HC}%command sender%{@CC} logged out."
- delete {ChunkApoc::Running}
- teleport command sender to (location 1 above {ChunkApoc::Location})
- if {@Coords.Spam.Chat} is true:
- message "{@P}{@CC} %{ChunkApoc::Location}%"
- chance of {ChunkApoc::Percent}%:
- loop 256 times:
- 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.5) of the world {ChunkApoc::World})):
- loop blocks from loop-block-1 to (block 16.5 west of loop-block-1):
- set loop-block-2 to air
- add 1 to {ChunkApoc::Time}
- wait {@ChunkApoc.TP.Delay}
- #= Deletion of Variable =#
- delete {ChunkApoc::*}
- #= Final TP to 0,0 =#
- set {_FinalLoc} to (location at (0, 256, 0) of the world (world of command sender))
- while (block at {_FinalLoc}) is air:
- set {_FinalLoc} to location 1 below {_FinalLoc}
- if y-coordinate of {_FinalLoc} is less than 3:
- message "{@P}{@CC} Error: Could not teleport {@HC}%command sender%{@CC} to 0,0."
- stop trigger
- wait 1 tick
- teleport command sender to (location 1 above {_FinalLoc})
- #= Final Broadcast =#
- message "{@P}{@CC} You were TPed to {@HC}0,%y-coordinate of command sender%,0!"
- broadcast "&a&k--------------{@P}&a&k--------------"
- broadcast "&a&k--{@HC} ChunkApocning has been completed!"
- broadcast "&a&k--{@CC} Reapply your {@HC}Worldborder!"
- broadcast "&a&k--------------{@P}&a&k--------------"
- loop 7 times:
- command "/ChunkApoc-sound fireworks.launch"
- command "/ChunkApoc-sound fireworks.twinkle"
- wait 4 ticks
- #= Sound Command =#
- command /ChunkApoc-sound <text>:
- permission: skript.ChunkApoc
- trigger:
- loop all players:
- execute console command "/playsound %arg% %loop-player% ~ ~ ~ 1 1 1"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement