Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- P: &8[&7Pregen&8]
- CC: &a
- HC: &6
- Pregen.TP.Delay: 1 ticks
- Correct.Usage: /pregen <radius> <world>
- Broadcast.Messages: true
- WB.Fill.Speed: 100
- command /pregen [<integer>] [<world>]:
- permission: skript.op
- trigger:
- if {Pregen::Running} is true:
- if arg-1 is not set:
- 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
- loop 3 times:
- command "/pregen-sound note.harp"
- wait 4 ticks
- command sender command "/wb set %arg-1%"
- broadcast "{@P}{@CC}&r&k----------------------------------"
- broadcast "{@P}{@HC} %command sender%{@CC}: {@HC}%arg-1%{@CC} in {@HC}%arg-2%!"
- broadcast "{@P}{@CC} Beginning pregen! There may be lag! Do not log out!"
- broadcast "{@P}{@HC} Pregen Skript by Fleft"
- broadcast "{@P}{@CC}&r&k----------------------------------"
- set command sender's gamemode to creative
- set {Pregen::Running} to true
- 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
- set {Pregen::Notify} to now
- wait 1 second
- set {_count} to 3
- loop 3 times:
- broadcast "{@P}{@CC} Starting:{@HC} %{_count}%..."
- command "/pregen-sound note.harp"
- subtract 1 from {_count}
- wait 1 second
- 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
- if {@Broadcast.Messages} is true:
- if {Pregen::Notify} was more than 5 seconds ago:
- broadcast "{@P}{@CC} Progress: {@HC}%{Pregen::Time}%%%"
- set {Pregen::Notfy} to now
- command "/pregen-sound note.harp"
- set {Pregen::Loop.1} to 0
- loop ({Pregen::Radius}*2) times:
- {Pregen::Running} is not set:
- delete {Pregen::*}
- broadcast "{@P}{@HC} Cancelled!"
- command "/pregen-sound random.break"
- wait 5 ticks
- 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:
- message "{@P}{@CC} Error: Could not teleport {@HC}%command sender%{@CC} to 0,0."
- 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!"
- delete {Pregen::Location}
- 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:
- if {@Broadcast.Messages} is true:
- 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% seconds."
- 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!"
- command sender command "/wb set %arg-1%"
- wait 1 tick
- command sender command "/wb fill {@WB.Fill.Speed}"
- wait 1 tick
- command sender command "/wb fill confirm"
- loop 3 times:
- command "/pregen-sound note.harp"
- wait 3 ticks
- broadcast "{@P}{@CC}&r&k----------------------------------"
- broadcast "{@P}{@CC} Automatically finishing pregen using"
- broadcast "{@P}{@HC} WorldBorder!{@CC} May be small lag!"
- broadcast "{@P}{@CC}&r&k----------------------------------"
- execute console command "/pregen-sound random.explode"
- command /pregen-sound <text>:
- permission: skript.pregen
- trigger:
- loop all players:
- execute console command "/playsound %arg% %loop-player% ~ ~ ~ 1 1 1"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement