Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- P: &8[&dPregen&8]
- CC: &r
- HC: &b
- Pregen.TP.Delay: 1 tick #0.025 seconds
- Correct.Usage: /pregen &b<radius> <world>
- Broadcast.Messages: true
- WB.Fill.Speed: 100
- Coords.Spam.Chat: false
- Playsound: false
- command /skpregen [<integer>] [<world>]:
- permission: skript.op
- trigger:
- if {Pregen::Running} is true:
- if arg-1 is not set:
- delete {Pregen::Running}
- stop trigger
- else if arg-1 is set:
- message "{@P}{@HC} To cancel, use /pregen"
- stop trigger
- if arg-2 is not set:
- message "{@P}{@CC} {@Correct.Usage}"
- stop trigger
- loop 3 times:
- command "/pregen-sound note.harp"
- wait 3 ticks
- set {Pregen::Location} to (location at (0, 255, 0) of the world (arg-2))
- 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."
- command "/pregen-sound random.break"
- stop trigger
- wait 1 tick
- teleport command sender to (location 1 above {Pregen::Location})
- #command sender command "/wb set %arg-1%"
- 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 pregen! Do not log out!"
- broadcast "&a&k--{@CC} Pregen Skript by Fleft"
- broadcast "&a&k--------------{@P}&a&k--------------"
- set command sender's gamemode to creative
- set {Pregen::Running} to true
- set {Pregen::Radius} to arg-1
- add 256 to {Pregen::Radius}
- 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)-1)
- if {Pregen::Notify} was more than 5 seconds ago:
- set {Pregen::Notfy} to now
- if {@Broadcast.Messages} is true:
- broadcast "{@P}{@CC} Progress: {@HC}%{Pregen::Time}%%%"
- if {@Playsound} is true:
- command "/pregen-sound note.harp"
- else:
- message "{@P}{@CC} Progress: {@HC}%{Pregen::Time}%%%"
- 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})
- if {@Coords.Spam.Chat} is true:
- message "{@P}{@CC} %{Pregen::Location}%"
- add 1 to {Pregen::Time}
- wait {@Pregen.TP.Delay}
- 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 3:
- 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"
- broadcast "&a&k--------------{@P}&a&k--------------"
- broadcast "&a&k--{@HC} Pregenning has been completed!"
- broadcast "&a&k--------------{@P}&a&k--------------"
- loop 7 times:
- command "/pregen-sound fireworks.launch"
- command "/pregen-sound fireworks.twinkle"
- wait 3 ticks
- command "/pregen-sound random.levelup"
- 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