Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Scatter Skript by Fleft. This is an advanced Skript. Use at your own risk. I am not responsible for any damage caused to servers because of this Skript.
- # To disable/enable and of these features below, change them to simply "true" or "false".
- # This was meant to be used in UHC games on www.reddit.com/r/ultrahardcore.
- # Version: v1.3
- options:
- #--------------------------------------------------
- # Options
- #--------------------------------------------------
- P: §f[§7Scatter]
- # Prefix for scatter messages
- H: §9
- # Chat color when there's **x** seconds, **player**, misc
- C: §f
- # Main chat color
- Tries: 1001
- # Limit to how many times the Skript will attempt to load a given location
- #--------------------------------------------------
- # Command
- #--------------------------------------------------
- command /scatterstar [<world>] [<integer>] [<text>]:
- permission: skript.fleftscatter
- trigger:
- if arg-3 is "all" or "*":
- set {_ListOfAllPlayers::*} to all players
- set {_AmountOfPlayers} to (size of {_ListOfAllPlayers::*})
- loop {_ListOfAllPlayers::*}:
- add 1 to {_count}
- set {_ListOfAllPlayers::%{_count}%} to loop-value
- if (size of ({_ListOfAllPlayers::*})) is equal to 0:
- message "{@P}{@C} No one can be scattered!"
- stop trigger
- set {Scatter.DisableChunkUnload} to true
- set {_world} to arg-1
- set {_radius} to arg-2
- set {_mindist} to (({_radius}/{_AmountOfPlayers})*3)
- broadcast "{@P}{@C} Attempting to scatter {@H}%{_AmountOfPlayers}%{@C} players!"
- loop {_AmountOfPlayers} times:
- loop {@Tries} times:
- if loop-number-2 is equal to {@Tries}:
- broadcast "{@P}{@C} Could not scatter %loop-number-1%/%{_AmountOfPlayers}%"
- broadcast "{@P}{@C} Some players may have been scattered!"
- broadcast "{@P}{@C} You may want to /tpall!"
- 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:
- if {_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 {_GroundLocation} to (location 1 above {_GroundLocation})
- add {_GroundLocation} to {_FinalLocations.Ground::*}
- add {_GroundLocation} to {_FinalLocations::*}
- wait 1 tick
- stop loop
- loop {_AmountOfPlayers} times:
- add 1 to {_Scattered}
- if {_Scattered} is equal to ({_AmountOfPlayers}/4):
- broadcast "{@P}{@C} Progress: 25%%"
- command sender is not online:
- broadcast "{@P}{@C} Scatter failed, command sender logged out."
- command "/aps random.break"
- stop trigger
- else:
- set {_FinalLocation} to {_FinalLocations::%loop-number%}
- remove {_FinalLocation} from {_FinalLocations::*}
- teleport (command sender) to {_FinalLocation}
- if {_ListOfAllPlayers::%loop-number%} is equal to (command sender):
- set {_CommandSenderLocation} to {_FinalLocation}
- wait 5 ticks
- teleport {_ListOfAllPlayers::%loop-number%} to (command sender)
- if {_CommandSenderLocation} is set:
- teleport (command sender) to {_CommandSenderLocation}
- broadcast "{@P}{@C} All players scattered"
- delete {Scatter.DisableChunkUnload}
- loop 10 times:
- command "/aps note.harp"
- command "/aps fireworks.launch"
- command "/aps fireworks.twinkle"
- wait 2 ticks
- #--------------------------------------------------
- # End of Scatter - Event section (and sound command)
- #--------------------------------------------------
- on chunk unload:
- {Scatter.DisableChunkUnload} is true:
- cancel the event
- on skript start:
- delete {Scatter.DisableChunkUnloading}
Add Comment
Please, Sign In to add comment