Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- #--------------------------------------------------
- # Options
- #--------------------------------------------------
- P: §7[§bScatter§7]
- # Prefix for scatter messages
- H: §c
- # Chat color when there's **x** seconds, **player**, misc
- C: §f
- # Main chat color
- H2: §a
- # Second highlight
- Tries: 1001
- # Limit to how many times the Skript will attempt to load a given location
- command /scatterall [<world>] [<integer>] [<integer>]:
- permission: skript.fleftscatter
- trigger:
- if arg-1 is not set:
- message "{@P}{@C} /scatterall <world> <radius> <mindist>"
- else if arg-2 is not set:
- message "{@P}{@C} /scatterall <world> <radius> <mindist>"
- else if arg-3 is not set:
- message "{@P}{@C} /scatterall <world> <radius> <mindist>"
- else:
- set {_Players::*} to all players
- set {_Amount} to (size of {_Players::*})
- loop {_Players::*}:
- add 1 to {_count}
- set {_Players::%{_count}%} to loop-value
- set {Scatter.DisableChunkUnload} to true
- set {_world} to arg-1
- set {_radius} to arg-2
- set {_mindist} to arg-3
- set {_pause} to ceil({_Amount}/10)
- broadcast "%{_pause}%"
- broadcast "{@P}{@C} Attempt: Radius {@H}%{_radius}%{@C} and mindist {@H}%{_mindist}%!"
- command "/aps fireworks.twinkle"
- wait 20 ticks
- loop {_Amount} times:
- loop {@Tries} times:
- if loop-number-2 is equal to {@Tries}:
- broadcast "{@P}{@C} Scatter failed!"
- broadcast "{@P}{@C} Lowest mindist?"
- command "/aps random.break"
- delete {Scatter.DisableChunkLoading}
- stop trigger
- set {_GoodLocation} to true
- set {_SkyLocation} to (the location at ((random integer between (0-{_radius}) and ({_radius}-1))+0.5), 255, ((random integer between (0-{_radius}) and ({_radius}-1))+0.5) of the world {_world})
- loop ((loop-number-1)-1) times:
- {_GoodLocation} is true
- distance between {_SkyLocation} and {_FinalLocations.Sky::%loop-number-3%} is less than {_mindist}
- delete {_GoodLocation}
- if {_GoodLocation} is true:
- set {_GroundLocation} to {_SkyLocation}
- while (block at {_GroundLocation}) is air:
- if y-coordinate of {_GroundLocation} is less than 5:
- delete {_GoodLocation}
- stop loop
- set {_GroundLocation} to location 1 below {_GroundLocation}
- if {_GoodLocation} is true:
- if (block at {_GroundLocation}) is cactus, water, or lava:
- delete {_GoodLocation}
- if {_GoodLocation} is true:
- set {_FinalLocations.Sky::%loop-number-1%} to {_SkyLocation}
- set {_GroundLocation} to (location 1 above {_GroundLocation})
- set {_FinalLocations::%loop-number-1%} to {_GroundLocation}
- wait 1 tick
- stop loop
- broadcast "{@P}{@C} Chunkload should take %{_Amount}/2% seconds."
- command "/aps note.bass"
- loop {_Amount} times:
- command sender is not online:
- broadcast "{@P}{@C} Scatter failed, command sender logged out."
- command "/aps random.break"
- stop trigger
- else:
- teleport (command sender) to {_FinalLocations::%loop-number%}
- message "{@P}{@H} Chunkload:{@C} [{@H2}%loop-number%{@C}/%{_Amount}%]"
- wait 10 ticks
- broadcast "{@P}{@C} Chunkload complete…"
- wait 20 ticks
- broadcast "{@P}{@C} Scattering all players."
- wait 20 ticks
- loop {_Amount} times:
- if {_Players::%loop-number%} is not online:
- broadcast "{@P}{@H} %{_Players::%loop-number%}% {@C}- Scheduled"
- set {ScatterScheduler::%{_Players::%loop-number%}%} to {_FinalLocations::%loop-number%}
- else:
- add 1 to {_pausetimer}
- if {_pausetimer} is equal to {_pause}:
- set {_pausetimer} to 0
- wait 10 ticks
- broadcast "{@P}{@H} %{_Players::%loop-number%}% {@C}[%loop-number%/%{_Amount}%]"
- teleport {_Players::%loop-number%} to {_FinalLocations::%loop-number%}
- command "/aps note.harp 2"
- wait 1 tick
- command "/aps mob.enderdragon.growl"
- broadcast "{@P}{@C} &aAll players scattered."
- delete {Scatter.DisableChunkUnload}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement