Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- Prefix: &8[&bFavonius&8]&r
- MaxTries: 1001
- ChunkWaitTicks: 10
- ScatterWaitTicks: 1
- # variables
- # {Teams::*} - list of integer - all team numbers currently active
- # {Team.%integer%.Set} - true/null - Team created?
- # {Team.%integer%::*} - list of "text" - player names in that team (TEXT!)
- # {Teams.InTeam::%player%} - integer/null - what team is player in?
- command /scatterteams <world> <integer> <integer>:
- usage: /scatterteams <world> <radius> <mindist>
- permission: skript.teams
- trigger:
- set {_Count} to 0
- loop {Teams::*}:
- {Team.%loop-value%::*} is set
- increase {_Count} by 1
- add {_Count} to {_Scatter.Teams::*}
- set {_Scatter.Team.%{_Count}%::*} to {Team.%loop-value%::*}
- loop all players:
- {Teams.InTeam::%loop-player%} is not set
- add (name of loop-player) to {_Solos::*}
- broadcast "&7-----------------------------------"
- broadcast "{@Prefix} Teams are being scattered!"
- set {_Size} to ((size of {_Scatter.Teams::*})+(size of {_Solos::*}))
- # this is copied from the above scatter
- loop {_Size} times:
- loop {@MaxTries} times:
- if loop-number-2 is equal to {@MaxTries}:
- message "{@Prefix} Could not get position &7[&f%loop-number-1%&9/&f%{_Size}%&7]"
- command "/scatter-playsound random.break"
- stop trigger
- set {_ThisLocation.Okay} to true
- set {_ThisLocation.Sky} to (the location at ((random integer between (0-(arg 2)) and ((arg 2)-1))+0.5), 255, ((random integer between (0-(arg 2)) and ((arg 2)-1))+0.5) of the world (arg 1))
- loop ((loop-number-1)-1) times:
- {_ThisLocation.Okay} is true
- distance between {_ThisLocation.Sky} and {_FinalLocation.Sky::%loop-number-3%} is less than (arg 3)
- delete {_ThisLocation.Okay}
- if {_ThisLocation.Okay} is true:
- set {_ThisLocation.Ground} to {_ThisLocation.Sky}
- while (block at {_ThisLocation.Ground}) is air:
- if y-coordinate of {_ThisLocation.Ground} is less than 4:
- delete {_ThisLocation.Okay}
- stop loop
- set {_ThisLocation.Ground} to location 1 below {_ThisLocation.Ground}
- if {_ThisLocation.Okay} is true:
- if (block at {_ThisLocation.Ground}) is lava, water or cactus:
- delete {_ThisLocation.Okay}
- if {_ThisLocation.Okay} is true:
- set {_FinalLocation.Sky::%loop-number-1%} to {_ThisLocation.Sky}
- set {_FinalLocation.Ground::%loop-number-1%} to (location 1 above {_ThisLocation.Ground})
- stop loop
- set {Scatter.DisableChunkUnloading} to true
- set {_ApproxTime} to {_Size}*{@ChunkWaitTicks}/20
- broadcast "{@Prefix} Scatter will take &a%{_ApproxTime}%&r seconds!"
- loop {_Size} times:
- if command sender is not online:
- broadcast "{@Prefix} Operation failed, chunkloading player logged out."
- command "/scatter-playsound random.break"
- stop trigger
- teleport (command sender) to {_FinalLocation.Ground::%loop-number%}
- message "{@Prefix} &aLoading: &7[&a%loop-number%&7/&b%{_Size}%&7]" to command sender
- wait {@ChunkWaitTicks} ticks
- broadcast "&7-----------------------------------"
- wait 40 ticks
- set {_TeamSize} to (size of {_Scatter.Teams::*})
- set {_SoloSize} to (size of {_Solos::*})
- set {_PositionCount} to 0
- set {_TeamCount} to 0
- set {_SoloCount} to 0
- loop {_Scatter.Teams::*}:
- increase {_PositionCount} by 1
- increase {_TeamCount} by 1
- loop {_Scatter.Team.%loop-value%::*}:
- set {_Player} to ("%loop-value-2%" parsed as offlineplayer)
- if {_Player} is not online:
- broadcast "{@Prefix} Scheduled late scatter of &a%{_Player}%."
- set {ScatterScheduler::%{_Player}%} to {_FinalLocation.Ground::%{_PositionCount}%}
- else:
- teleport {_Player} to {_FinalLocation.Ground::%{_PositionCount}%}
- execute console command "/sall note.bass 1"
- wait {@ScatterWaitTicks} ticks
- loop {_Solos::*}:
- increase {_PositionCount} by 1
- increase {_SoloCount} by 1
- set {_Player} to ("%loop-value%" parsed as offlineplayer)
- if {_Player} is not online:
- broadcast "{@Prefix} Scheduled late scatter of &a%{_Player}%!"
- set {ScatterScheduler::%{_Player}%} to {_FinalLocation.Ground::%{_PositionCount}%}
- else:
- teleport {_Player} to {_FinalLocation.Ground::%{_PositionCount}%}
- wait {@ScatterWaitTicks} ticks
- broadcast "{@Prefix} All teams scattered!"
- broadcast "&7-----------------------------------"
- execute console command "/sall random.successful_hit 0.5"
- delete {Scatter.DisableChunkUnloading}
- on chunk unload:
- {Scatter.DisableChunkUnloading} is true
- cancel the event
- on skript start:
- delete {Scatter.DisableChunkUnloading}
- on join:
- {ScatterScheduler::%player%} is set
- teleport player to {ScatterScheduler::%player%}
- delete {ScatterScheduler::%player%}
- broadcast "{@Prefix}&r Scheduled late-scatter of &a%player%!"
- options:
- Prefix: &8[&bFavonius&8]&r
- MaxTries: 1001
- ChunkWaitTicks: 10
- ScatterWaitTicks: 1
- command /scatterffa <world> <integer> <integer>:
- description: Scatter command
- usage: /scatterffa <world> <radius> <mindist>
- permission: skript.scatter
- trigger:
- set {scattering} to true
- if (size of (all players)) is equal to 0:
- message "{@Prefix} Nobody online. Insert Sadface!"
- stop
- broadcast "&7-----------------------------------------------------"
- broadcast "{@Prefix} All players being scattered!"
- set {_Players::*} to all players
- set {_Size} to (size of {_Players::*})
- loop {_Size} times:
- loop {@MaxTries} times:
- if loop-number-2 is equal to {@MaxTries}:
- message "{@Prefix} Could not scatter &7[&f%loop-number-1%&7/&b%{_Size}%&7]"
- command "/scatter-playsound random.break"
- stop trigger
- set {_ThisLocation.Okay} to true
- set {_ThisLocation.Sky} to (the location at ((random integer between (0-(arg 2)) and ((arg 2)-1))+0.5), 255, ((random integer between (0-(arg 2)) and ((arg 2)-1))+0.5) of the world (arg 1))
- loop ((loop-number-1)-1) times:
- {_ThisLocation.Okay} is true
- distance between {_ThisLocation.Sky} and {_FinalLocation.Sky::%loop-number-3%} is less than (arg 3)
- delete {_ThisLocation.Okay}
- if {_ThisLocation.Okay} is true:
- set {_ThisLocation.Ground} to {_ThisLocation.Sky}
- while (block at {_ThisLocation.Ground}) is air:
- if y-coordinate of {_ThisLocation.Ground} is less than 4:
- delete {_ThisLocation.Okay}
- stop loop
- set {_ThisLocation.Ground} to location 1 below {_ThisLocation.Ground}
- if {_ThisLocation.Okay} is true:
- if (block at {_ThisLocation.Ground}) is lava, water or cactus:
- delete {_ThisLocation.Okay}
- if {_ThisLocation.Okay} is true:
- set {_FinalLocation.Sky::%loop-number-1%} to {_ThisLocation.Sky}
- set {_FinalLocation.Ground::%loop-number-1%} to (location 1 above {_ThisLocation.Ground})
- stop loop
- set {Scatter.DisableChunkUnloading} to true
- set {_ApproxTime} to {_Size}*{@ChunkWaitTicks}/20
- broadcast "{@Prefix} Scatter will take &a%{_ApproxTime}%&r seconds!"
- broadcast "&7-----------------------------------------------------"
- loop {_Size} times:
- if command sender is not online:
- broadcast "{@Prefix} Failed scatter! &a%command sender%&r logged out!"
- command "/scatter-playsound random.break"
- stop trigger
- teleport (command sender) to {_FinalLocation.Ground::%loop-number%}
- message "{@Prefix} Loading &7[&f%loop-number%&7/&a%{_Size}%&7]" to command sender
- wait {@ChunkWaitTicks} ticks
- broadcast "%{Fprefix}% 3…"
- make player execute command "/sall note.pling 0.5"
- wait 1 second
- broadcast "%{Fprefix}% 2…"
- make player execute command "/sall note.pling 1.0"
- wait 1 second
- broadcast "%{Fprefix}% 1…"
- make player execute command "/sall note.pling 1.5"
- wait 0.5 second
- broadcast "&7-----------------------------------------------------"
- set {_Count} to 0
- loop {_Players::*}:
- increase {_Count} by 1
- execute console command "/sall note.bass 1"
- if (loop-value) is not online:
- broadcast "{@Prefix} Not online: &7[&f%{_Count}%&9/&f%{_Size}%&7]&4 : &6%loop-value% &r- scheduling."
- set {ScatterScheduler::%loop-value%} to {_FinalLocation.Ground::%{_Count}%}
- else:
- teleport (loop-value) to {_FinalLocation.Ground::%{_Count}%}
- {_Count} is 1 or 5 or 10 or 15 or 20 or 25 or 30 or 35 or 40 or 45 or 50 or 55 or 60 or 65 or 70 or {_Size}:
- broadcast "{@Prefix} &7[&f%{_Count}%&7/&a%{_Size}%&7]&r Scattered!"
- wait {@ScatterWaitTicks} tick
- broadcast "{@Prefix} All players scattered!"
- broadcast "&7-----------------------------------------------------"
- make player execute command "/sall fireworks.launch 1"
- wait 15 ticks
- delete {Scatter.DisableChunkUnloading}
- set {scattering} to false
- wait 1 second
- make player execute command "/sall fireworks.largeBlast 1"
- command /scatter-playsound <text>:
- permission: skript.scatter.playsound
- trigger:
- loop all players:
- command "/playsound %arg 1% %loop-player%"
- on chunk unload:
- {Scatter.DisableChunkUnloading} is true
- cancel the event
- on join:
- {ScatterScheduler::%player%} is set
- teleport player to {ScatterScheduler::%player%}
- delete {ScatterScheduler::%player%}
- broadcast "{@Prefix} &aScheduled late-scatter of %player%."
- on chat:
- {scattering} is true:
- player is not op:
- cancel the event
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement