Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- P: &7[&ePregen&7]
- CC: &r
- HC: &b
- Pregen.TP.Delay: 1 ticks
- Correct.Usage: /pregen <radius> <world>
- Broadcast.Messages: true
- command /pregen [<integer>] [<world>]:
- permission: skript.op
- trigger:
- if {Pregen::Running} is true:
- if arg-1 is not set:
- broadcast "{@P}{@CC} Pregenning cancelled."
- delete {Pregen::Running}
- stop trigger
- else:
- message "{@P}{@CC} {@Correct.Usage}"
- if arg-1 is less than 16:
- message "{@P}{@CC} You cannot pregen with a radius less than 16!"
- stop trigger
- if arg-2 is not set:
- message "{@P}{@CC} {@Correct.Usage}"
- stop trigger
- broadcast "{@P}{@HC} %command sender%{@CC}: {@HC}%arg-1%{@CC} in {@HC}%arg-2%!"
- set command sender's gamemode to creative
- set {Pregen::Running} to true
- set {Pregen::Radius} to arg-1
- set {Pregen::Radius} to arg-1
- set {Pregen::World} to arg-2
- set {Pregen::Loop.1} to 0
- set {Pregen::Loop.2} to 0
- set {Pregen::Count} to 0
- set {Pregen::Time} to 0
- loop ({Pregen::Radius}*2) times:
- add 1 to {Pregen::Loop.1}
- if {Pregen::Loop.1} is equal to 16:
- set {Pregen::Time} to rounded down ((loop-number-1)/{Pregen::Radius})*50
- broadcast "{@P}{@CC} Progress: {@HC}%{Pregen::Time}%%%"
- set {Pregen::Loop.1} to 0
- loop ({Pregen::Radius}*2) times:
- {Pregen::Running} is not set:
- delete {Pregen::*}
- stop trigger
- add 1 to {Pregen::Loop.2}
- if {Pregen::Loop.2} is equal to 16:
- set {Pregen::Loop.2} to 0
- set {Pregen::x.coord} to ((loop-number-1)-{Pregen::Radius})
- set {Pregen::z.coord} to ((loop-number-2)-{Pregen::Radius})
- set {Pregen::Location} to (location at ({Pregen::x.coord}, 200, {Pregen::z.coord}) of the world ({Pregen::World}))
- while (block at {Pregen::Location}) is air:
- set {Pregen::Location} to location 1 below {Pregen::Location}
- if y-coordinate of {Pregen::Location} is less than 5:
- broadcast "{@P}{@CC} Void: skipping location"
- delete {Pregen::Location}
- if command sender is not online:
- broadcast "{@P}{@CC} Pregenning interrupted. {@HC}%command sender%{@CC} logged out."
- delete {Pregen::Running}
- teleport command sender to (location 1 above {Pregen::Location})
- add 1 to {Pregen::Time}
- wait {@Pregen.TP.Delay}
- broadcast "{@P}{@CC} Pregenning finished: ~{@HC}%{Pregen::Time}/16% minutes."
- delete {Pregen::*}
- set {Pregen::Location} to (location at (0, 255, 0) of the world (world of command sender))
- while (block at {Pregen::Location}) is air:
- set {Pregen::Location} to location 1 below {Pregen::Location}
- if y-coordinate of {Pregen::Location} is less than 5:
- broadcast "{@P}{@CC} Error: Could not teleport {@HC}%command sender%{@CC} to 0,0."
- delete {Pregen::Location}
- wait 1 tick
- teleport command sender to (location 1 above {Pregen::Location})
- message "{@P}{@CC} You were TPed to {@HC}0,%y-coordinate of command sender%,0!"
- execute console command "/pregen-sound random.explode"
- command /pregen-sound <text>:
- permission: skript.pregen
- trigger:
- loop all players:
- execute console command "/playsound %arg-1% loop-player ~ ~ ~ 1 1 1"
- command /megascatter <integer> <world>:
- permission: skript.op
- trigger:
- broadcast "{@P}{@HC} %command sender%{@CC}: {@HC}%arg-1%{@CC} in {@HC}%arg-2%!"
- set command sender's gamemode to creative
- set {FScatter::Running} to true
- set {FScatter::Radius} to arg-1
- set {FScatter::Radius} to arg-1
- set {FScatter::World} to arg-2
- set {FScatter::Loop.1} to 0
- set {FScatter::Loop.2} to 0
- set {FScatter::Count} to 0
- set {FScatter::Time} to 0
- set {_size} to (size of (all players))
- set {_size} to ({_size}/4)
- set {_players::*} to all players
- loop ({FScatter::Radius}*2) times:
- add 1 to {FScatter::Loop.1}
- if {FScatter::Loop.1} is equal to {_size}:
- set {FScatter::Time} to rounded down ((loop-number-1)/{FScatter::Radius})*50
- set {FScatter::Loop.1} to 0
- loop ({FScatter::Radius}*2) times:
- {FScatter::Running} is not set:
- delete {FScatter::*}
- stop trigger
- add 1 to {FScatter::Loop.2}
- if {FScatter::Loop.2} is equal to {_size}:
- set {FScatter::Loop.2} to 0
- set {FScatter::x.coord} to ((loop-number-1)-{FScatter::Radius})
- set {FScatter::z.coord} to ((loop-number-2)-{FScatter::Radius})
- set {FScatter::Location} to (location at ({FScatter::x.coord}, 200, {FScatter::z.coord}) of the world ({FScatter::World}))
- while (block at {FScatter::Location}) is air:
- set {FScatter::Location} to location 1 below {FScatter::Location}
- if y-coordinate of {FScatter::Location} is less than 5:
- broadcast "{@P}{@CC} Void: skipping location"
- delete {FScatter::Location}
- if command sender is not online:
- broadcast "{@P}{@CC} Scatter interrupted. {@HC}%command sender%{@CC} logged out."
- delete {FScatter::Running}
- teleport command sender to (location 1 above {FScatter::Location})
- set {FScatter::Player} to a random element out of {_players::*}
- while {FScatter::Player} is equal to the command sender:
- size of ({_players::*}) is greater than 1:
- set {FScatter::Player} to a random element out of {_players::*}
- set {FScatter::Player} to {FScatter::Player} parsed as offlineplayer
- teleport {FScatter::Player} to command sender
- add 1 to {FScatter::Time}
- wait {@Pregen.TP.Delay}
- delete {FScatter::*}
- set {FScatter::Location} to (location at (0, 255, 0) of the world (world of command sender))
- while (block at {FScatter::Location}) is air:
- set {FScatter::Location} to location 1 below {FScatter::Location}
- if y-coordinate of {FScatter::Location} is less than 5:
- broadcast "{@P}{@CC} Error: Could not teleport {@HC}%command sender%{@CC} to 0,0."
- delete {FScatter::Location}
- wait 1 tick
- teleport command sender to (location 1 above {FScatter::Location})
- message "{@P}{@CC} You were TPed to {@HC}0,%y-coordinate of command sender%,0!"
- execute console command "/pregen-sound random.explode"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement