Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #--------------------------------------------------#
- # Credits & things! #
- #--------------------------------------------------#
- # Nate's scatter skript, version [5.2] by NatePlays (/r/NatePlaysUHC & @NatePlaysUHC)
- # Skript 2.2+ & 1.8 ONLY Version (May work in 1.9-1.10, NOT TESTED IN 1.9-1.10)
- # Used this scatter on a different server for ~150 games for the past 4-6 months (of course other people hosted with it xd) perfect 19-20 (even in huge fills)
- # Need help installing it? Contact me through twitter! (@NatePlaysUHC)
- # Want to see it in action before using it? Then follow @OblivionUHC on Twitter to play a game! (Gonna host VERY soon, again!)
- # Thank you, Cam (Camaro6460), for making & letting me use the /invis part in the skript!
- # Compatible with D4's, Dvox's, Dancing's, & Midnight's (Guideless) team managers!
- # Feel free to send to anyone, just give the right credit!
- # Also, feel free to edit for your own use!
- # Used the same variables as Cam's & Midnight's (Guideless) scatter for easy customization!
- # Use at your own risk, I am not responsible for ANY server damage!
- # If you find ANY bugs, please tell me, either through Twitter or Reddit! (NatePlaysUHC)
- # Some parts of the skript are orginally NOT MINE
- # Other then that, hope you like it!
- #--------------------------------------------------#
- # Version Log (More for myself) #
- #--------------------------------------------------#
- # Version 1 - Horribly written, only scattered one player with the essentials TP command (Around December 2014)
- # 1.1 - Bug fixes (Do not ask me how there were bugs)
- # 1.2 - Added multiple player scatter (Like a solo scatter) running /tp (player) every 1 second
- # 1.3 to 1.7 - Just a lot of bug fixes & made the delay less & whatnot
- # Version 2 - Found D4's scatter & used his "find locations" part of the skript & some (I mean most) of his parts (Around January 2015)
- # 2.1 to 2.8 - Bug fixes (I literary rewrote it to my liking :P)
- # Version 3 - Turned "my" scatter to something like Fleft's before I found his on the reddit :/ (Turned it into one command! Instead of /scatterall, /scatterteams) (Around February to April 2015)
- # 3.1 - Fixed a TON of bugs, I mean a lot
- # 3.2 - Rewrote "my" scatter (It was basically the same as D4's before) to make it similar
- # 3.3 - Found efficient way of scattering now, it helped TPS a TON (Nice & slow like 2 minute scatter xd)
- # 3.4 - BUG FIXES
- # 3.5 - Added a "flexible" chunk loader delay & scatter delay
- # 3.6 - Fixed bugs & added a ton of options O.o
- # 3.7 to 3.9.9 - Tons & tons of bug fixes & cleaned up the code!
- # Version 4 - Rewrote the WHOLE scatter AGAIN, made it so efficient & high tech, it has a TON of new options & helps TPS 5-20x MORE! (May to November 2015)
- # 4.1 - Bug fixes :/ Added a spec variable option & a vanish one too (June 2015)
- # 4.2 - Fixed up the code & cleaned it up a little & added a few new options ;) (June 2015)
- # 4.3 - Bug fixes & made it even more efficient & made it help TPS more! (July 2015)
- # 4.4 - Added the "send to ops" part just to make everyone was scattered ;) (August 2015)
- # 4.5 - Bug fixes, added the TPS feature, added a LOT of this text & MORE options, added a /cancelscatter command, released it to my Twitter! (September & October 2015)
- # 4.6 to 4.8 - Getting it ready to release to the reddit, cleaning up the code & making everything look so nice, fixing the bugs! (October & November 2015)
- # 4.9 - Fixed as many bugs as I caught, tested it in a game, ~150 man fill, perfect 19 TPS during the scatter on a 4 gigabyte server on a 32 GB dedicated server from SYS (November 2015)
- # Version 5 - Redid the messages, made some of them into titles & action bars. (June 6, 2016 to Present)
- # 5.1 - Fixed all of the known bugs (July 1, 2016)
- # 5.2 - Fixed up the scatter to release to the reddit, changed "SEMTOp" to "SEMTAp" (July 11, 2016)
- # Decided to finally release my scatter skripts today. (9/17/16)
- options:
- #--------------------------------------------------#
- # Config/Options #
- #--------------------------------------------------#
- P: &c&lScatter &8»
- # Prefix! Ex: (Prefix)&c&lScatter &8» (Main Chat Color)Everyone is now invisible!
- C: &7
- # Main chat color! Ex: (Prefix)&c&lScatter &8» (Main Chat Color)The scatter is now (Highlight Chat Color)complete!
- H: &c
- # Highlight chat color! Ex: (Prefix)&c&lScatter &8» (Highlight Chat Color)You (Main Chat Color)were scattered!
- BC: &8
- # Bracket, colon, and etc. color, it is this "[]" and ":" in chat!
- Permission: skript.scatter
- # The permission you give ops/hosts/staff/etc. to use all of the commands!
- SEMTAp: true # Stands for "Send extra messages (action bar) to all players" **NOTE THIS DOES NOT INCLUDE THE TPS READING THAT IS ANOTHER OPTION!**
- # Would you like to send extra messages (action bar) to all players? (Example: Scatter » NatePlays was scattered! [1/1] & Scatter » Loading chunks » [1/1]) (Use "true" or "false")
- TPSR: true # Stands for "Send TPS readings to ops"
- # Would you like to send tps readings to ops? *Suggested you set this to "true"* (Use "true" or "false")
- Sounds: true
- # Do you want some great sounds?
- ScatterSound: random.pop
- # The main sound in the scatter!
- Tries: 1001
- # I do not suggest changing this!
- LoadGeneratedChunks: true
- # Ummm, load the generated chunks? This helps A LOT, HIGHLY suggested to use! Helps TPS on 99.99% of servers! (Use "true" or "false")
- Vanish: true
- # Vanish players while scattering? This helps TPS on 90% of servers! (HIGHLY SUGGESTED TO USE THIS OPTION) (Use "true" or "false") **Requires SimpleVanish plugin**
- Butcher: true
- # Butch mobs while scattering? (HIGHLY SUGGESTED TO USE THIS OPTION) (Use "true" or "false") **Requires Essentials**
- MobSpawning: true
- # Should mobs spawn while scattering? I suggest you set this to "true", but if you have horrible provider, like McProHosting (or just on a bad Minecrafted node :/) set it to "false" (Use "true" or "false")
- UnitRatePlayers: 200
- # The unit rate number in player amount!
- # Example: I want to wait 10 ticks between each chunk & 1 tick between each scatter of a player, with a 100 player fill in a FFA game,
- # so I would set this option to 100, the next to 10, and the one after that one to 1!
- UnitRateChunks: 10
- # The amount of ticks between each chunk to be loaded with the unit rate!**Use Ticks**
- # Example: I have 200 players in a FFA game, and my options are default in this config, then the math is 10/100*200, which equals 20 ticks,
- # so the chunkload player waits 20 ticks (1 second) before the chunkload player is teleported to the next chunk!
- UnitRateScatter: 1
- # The amount of ticks between each player to be scattered with the unit rate! **Use Ticks**
- # Example: I have 200 players in a FFA game, and my options are default in this config, then the math is 1/100*200, which equals 2 ticks,
- # so we wait 2 ticks, before the next player is scattered! (This does not effect the five second wait!)
- ScaTimes: 10
- # The amount of players gets scattered, then you wait 5 seconds for the next amount of players to be scattered!
- SpecVariable: {spec::%loop-player%}
- # Your spectating variable, if you are using a skript, if your using a plugin then this is worthless, ignore it!
- Version: 5.2
- # Don't change this
- #--------------------------------------------------#
- # Main Command #
- #--------------------------------------------------#
- command /sca [<world>] [<integer>] [<text>] [<integer>] [<integer>] [<integer>] [<integer>] [<integer>]:
- aliases: /teamsscatter, /scatterall, /teamscatter
- permission: {@Permission}
- trigger:
- #--------------------------------------------------#
- # Arguments #
- #--------------------------------------------------#
- if arg-1 is not set:
- send "{@P}{@H} /sca {@BC}<{@H}world{@BC}> <{@H}radius{@BC}> <{@H}*/teams/player{@BC}> {@BC}[{@C}Mindist{@BC}] [{@C}X-Coordinate{@BC}] [{@C}Z-Coordinate{@BC}] [{@C}Chunk Load Ticks{@BC}] [{@C}Scatter Ticks{@BC}]"
- command "/playsound random.break %command sender% ~ ~ ~ 1 1 1"
- stop trigger
- else if arg-2 is not set:
- send "{@P}{@H} /sca {@BC}<{@H}world{@BC}> <{@H}radius{@BC}> <{@H}*/teams/player{@BC}> {@BC}[{@C}Mindist{@BC}] [{@C}X-Coordinate{@BC}] [{@C}Z-Coordinate{@BC}] [{@C}Chunk Load Ticks{@BC}] [{@C}Scatter Ticks{@BC}]"
- command "/playsound random.break %command sender% ~ ~ ~ 1 1 1"
- stop trigger
- else if arg-3 is not set:
- send "{@P}{@H} /sca {@BC}<{@H}world{@BC}> <{@H}radius{@BC}> <{@H}*/teams/player{@BC}> [{@C}Mindist{@BC}] [{@C}X-Coordinate{@BC}] [{@C}Z-Coordinate{@BC}] [{@C}Chunk Load Ticks{@BC}] [{@C}Scatter Ticks{@BC}]"
- command "/playsound random.break %command sender% ~ ~ ~ 1 1 1"
- stop trigger
- #--------------------------------------------------#
- # FFA/Solo Scatter #
- #--------------------------------------------------#
- if arg-3 is "all" or "*":
- if command sender is console:
- stop trigger
- set {Scatter.Scattering} to true
- set {_ToScatter::*} to (all players)
- loop all players:
- {@SpecVariable} is true
- remove loop-player from {_ToScatter::*}
- set {_Size} to (size of {_ToScatter::*})
- if arg-4 is set:
- if arg-4 is equal to 0:
- set {_Mindist} to (((arg-2 * 2) - 250)/{_Size})*3.5
- if arg-2 is less than {_Mindist}:
- set {_Mindist} to argument 2-100
- else if arg-2 is less than 1:
- set {_Mindist} to argument 2-100
- else:
- set {_Mindist} to arg-4
- else:
- set {_Mindist} to (((arg-2 * 2) - 250)/{_Size})*3.5
- if arg-2 is less than {_Mindist}:
- set {_Mindist} to argument 2-100
- else if arg-2 is less than 1:
- set {_Mindist} to argument 2-100
- if arg-5 is set:
- set {_X} to arg-5
- else:
- set {_X} to 0
- if arg-6 is set:
- set {_Z} to arg-6
- else:
- set {_Z} to 0
- if arg-7 is set:
- set {_ChunkLoadTicks} to arg-7
- else:
- set {_ChunkLoadTicks} to round({@UnitRateChunks}/{@UnitRatePlayers}*{_Size})
- if arg-8 is set:
- set {_ScatterTicks} to arg-8
- else:
- set {_ScatterTicks} to round({@UnitRateScatter}/{@UnitRatePlayers}*{_Size})
- if {_ChunkLoadTicks} is 0:
- set {_ChunkLoadTicks} to 1
- if {_ScatterTicks} is 0:
- set {_ScatterTicks} to 1
- while (block at {_CMDLocB}) is air:
- set {_CMDLocB} to location 1 below {_CMDLocB}
- if y-coordinate of {_CMDLocB} is less than 3:
- set {_CMDLocB} to (location at (0, 256, 0) of the world arg-1)
- wait 1 tick
- teleport the command sender to (location 1 above {_CMDLocB})
- if {@MobSpawning} is false:
- player command "/gamerule doMobSpawning false"
- set {_ApproxTime} to ({_Size}*({_ChunkLoadTicks}+{_ScatterTicks})/20)+(({_Size}/{@ScaTimes})*5)
- broadcast "{@P}{@C} Attempting to scatter {@BC}[{@H}%{_Size}%{@C}{@BC}] {@C}players around {@BC}[{@H}%{_X}%,%{_Z}%{@BC}]!"
- command "/scattersound"
- wait 2 ticks
- broadcast "{@P}{@C} Lowest Mindist{@BC}: {@H}%{_Mindist}%{@C} Radius{@BC}: {@H}%arg-2%"
- command "/scattersound"
- wait 2 ticks
- broadcast "{@P}{@C} Chunk Loading Ticks{@BC}: {@H}%{_ChunkLoadTicks}%{@C} Scatter Ticks{@BC}: {@H}%{_ScatterTicks}%"
- command "/scattersound"
- wait 2 ticks
- broadcast "{@P}{@C} This operation will take approximately {@H}%{_ApproxTime}% seconds!"
- command "/scattersound"
- loop ({_Size}) times:
- # if {Scatter.Cancel} is true:
- # exit loop
- loop {@Tries} times:
- if (loop-number-2) is {@Tries}:
- set {_Mindist} to 200
- loop ({_Size}) times:
- loop {@Tries} times:
- if (loop-number-2) is {@Tries}:
- broadcast "{@P}{@C}Couldn't scatter {@BC}[{@H}%({_Size})-(loop-number-1)%{@BC}/{@H}%{_Size}%{@BC}]{@C} players!"
- send "{@P} {@C}Locations couldn't be found! {@BC}[{@C}Too big of a {@H}mindist!{@BC}]"
- send "{@P} {@C}You may want to do {@H}/tpall!"
- command "/scatterbroke"
- stop trigger
- set {_Location.Good} to true
- set {_Location.Sky} to (the location at (random integer between ({_X}-arg-2) and ({_X}+arg-2)), 255, (random integer between ({_Z}-arg-2) and ({_Z}+arg-2)) of the world (arg-1))
- loop ((loop-number-1)-1) times:
- (distance between {_Location.Sky} and {_GoodLocation.Sky::%loop-number-3%}) is less than ({_Mindist})
- delete {_Location.Good}
- if {_Location.Good} is true:
- set {_Location.GroundLevel} to {_Location.Sky}
- while (block at {_Location.GroundLevel}) is air:
- if (y-coordinate of ({_Location.GroundLevel})) is less than 4:
- delete {_Location.Good}
- exit loop
- set {_Location.GroundLevel} to (location 1 below ({_Location.GroundLevel}))
- if {_Location.Good} is true:
- if (block at {_Location.GroundLevel}) is lava, water or cactus:
- delete {_Location.Good}
- else:
- set {_GoodLocation.Sky::%loop-number-1%} to ({_Location.Sky})
- set {_GoodLocation.GroundLevel::%loop-number-1%} to (location 1 above {_Location.GroundLevel})
- wait 1 tick
- exit 9 sections
- set {_Location.Good} to true
- set {_Location.Sky} to (the location at (random integer between ({_X}-arg-2) and ({_X}+arg-2)), 255, (random integer between ({_Z}-arg-2) and ({_Z}+arg-2)) of the world (arg-1))
- loop ((loop-number-1)-1) times:
- (distance between {_Location.Sky} and {_GoodLocation.Sky::%loop-number-3%}) is less than ({_Mindist})
- delete {_Location.Good}
- if {_Location.Good} is true:
- set {_Location.GroundLevel} to {_Location.Sky}
- while (block at {_Location.GroundLevel}) is air:
- if (y-coordinate of ({_Location.GroundLevel})) is less than 4:
- delete {_Location.Good}
- exit loop
- set {_Location.GroundLevel} to (location 1 below ({_Location.GroundLevel}))
- if {_Location.Good} is true:
- if (block at {_Location.GroundLevel}) is lava, water or cactus:
- delete {_Location.Good}
- else:
- set {_GoodLocation.Sky::%loop-number-1%} to ({_Location.Sky})
- set {_GoodLocation.GroundLevel::%loop-number-1%} to (location 1 above {_Location.GroundLevel})
- wait 1 tick
- exit loop
- loop {_ToScatter::*}:
- if {Scatter.Cancel} is true:
- exit loop
- set {Scatter.Scattering::%loop-value%} to true
- if {@Vanish} is true:
- if {Scatter.Cancel} is not set:
- command "/invis on"
- if {Scatter.Cancel} is not set:
- set {Scatter.DontUnloadChunks} to true
- broadcast ""
- set {_Time} to now
- set {_Size2} to {_Size}
- broadcast "{@P} {@C}Locations found! Starting the {@H}scatter {@C}process!"
- while {_Size2} is more than 0:
- if {Scatter.Cancel} is true:
- exit loop
- if {_Size2} is less than {@ScaTimes}+1:
- if {@LoadGeneratedChunks} is true:
- loop {_Size2} times:
- if command sender is not online:
- broadcast "{@P} {@C}Stopping {@H}scatter! {@C}Chunkloading player logged out."
- command "/scatterbroke"
- stop trigger
- add 1 to {_Chunks}
- teleport command sender to {_GoodLocation.GroundLevel::%{_Chunks}%}
- if {@SEMTAp} is true:
- send action bar from "{@C}Loading chunks {@BC}» {@BC}[{@H}%{_Chunks}%{@BC}/{@H}%{_Size}%{@BC}]" to all players
- if {@Butcher} is true:
- player command "/killall monsters"
- loop {_ChunkLoadTicks} times:
- wait 1 tick
- loop {_Size2} times:
- if {@LoadGeneratedChunks} is not true:
- if {@Butcher} is true:
- player command "/killall monsters"
- set {_Scatter.Player} to a random element out of {_ToScatter::*}
- set {_Scatter.Player} to {_Scatter.Player} parsed as offlineplayer
- remove {_Scatter.Player} from {_ToScatter::*}
- add 1 to {_Scattered}
- if {_Scatter.Player} is not online:
- if {_Scatter.Player} is "%command sender%":
- set {_CMDSender} to {_GoodLocation.GroundLevel::%{_Scattered}%}
- if {@SEMTAp} is true:
- send action bar from "{@H}%{_Scatter.Player}% {@C}wasn't scattered, since he/she is the {@H}command sender! {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_Size}%{@BC}]" to all players
- else:
- set {SchedueldScatter::%{_Scatter.Player}%} to ({_GoodLocation.GroundLevel::%{_Scattered}%})
- if {@SEMTAp} is true:
- send action bar from "&4&lOFFLINE {@BC}- {@H}%{_Scatter.Player}% {@C}scheduled to be {@H}scattered! {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_Size}%{@BC}]" to all players
- else:
- if {_Scatter.Player} is "%command sender%":
- set {_CMDSender} to {_GoodLocation.GroundLevel::%{_Scattered}%}
- else:
- teleport {_Scatter.Player} to ({_GoodLocation.GroundLevel::%{_Scattered}%})
- send title from "{@H}You {@C}were scattered!" and "{@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_Size}%{@BC}]" to {_Scatter.Player} for 20, 20, 20
- if {@SEMTAp} is true:
- send action bar from "{@H}%{_Scatter.Player}% {@C}was scattered! {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_Size}%{@BC}]" to all players
- loop {_ScatterTicks} times:
- wait 1 tick
- set {_Size2} to 0
- exit loop
- else:
- if {@LoadGeneratedChunks} is true:
- loop {@ScaTimes} times:
- if command sender is not online:
- broadcast "{@P} {@C}Stopping {@H}scatter! {@C}Chunkloading player logged out."
- command "/scatterbroke"
- stop trigger
- add 1 to {_Chunks}
- teleport command sender to {_GoodLocation.GroundLevel::%{_Chunks}%}
- if {@SEMTAp} is true:
- send action bar from "{@C}Loading chunks {@BC}» {@BC}[{@H}%{_Chunks}%{@BC}/{@H}%{_Size}%{@BC}]" to all players
- if {@Butcher} is true:
- player command "/killall monsters"
- loop {_ChunkLoadTicks} times:
- wait 1 tick
- loop {@ScaTimes} times:
- if {@LoadGeneratedChunks} is not true:
- if {@Butcher} is true:
- player command "/killall monsters"
- set {_Scatter.Player} to a random element out of {_ToScatter::*}
- set {_Scatter.Player} to {_Scatter.Player} parsed as offlineplayer
- remove {_Scatter.Player} from {_ToScatter::*}
- remove 1 from {_Size2}
- add 1 to {_Scattered}
- if {_Scatter.Player} is not online:
- if {_Scatter.Player} is "%command sender%":
- set {_CMDSender} to {_GoodLocation.GroundLevel::%{_Scattered}%}
- if {@SEMTAp} is true:
- send action bar from "{@H}%{_Scatter.Player}% {@C}wasn't scattered, since he/she is the {@H}command sender! {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_Size}%{@BC}]" to all players
- else:
- set {SchedueldScatter::%{_Scatter.Player}%} to ({_GoodLocation.GroundLevel::%{_Scattered}%})
- if {@SEMTAp} is true:
- send action bar from "&4&lOFFLINE {@BC}- {@H}%{_Scatter.Player}% {@C}scheduled to be {@H}scattered! {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_Size}%{@BC}]" to all players
- else:
- if {_Scatter.Player} is "%command sender%":
- set {_CMDSender} to {_GoodLocation.GroundLevel::%{_Scattered}%}
- else:
- teleport {_Scatter.Player} to ({_GoodLocation.GroundLevel::%{_Scattered}%})
- send title from "{@H}You {@C}were scattered!" and "{@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_Size}%{@BC}]" to {_Scatter.Player} for 20, 20, 20
- if {@SEMTAp} is true:
- send action bar from "{@H}%{_Scatter.Player}% {@C}was scattered! {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_Size}%{@BC}]" to all players
- loop {_ScatterTicks} times:
- wait 1 tick
- if {_Size2} is more than {@ScaTimes}:
- broadcast "{@P}{@C} Scattered {@BC}[{@H}%{_Scattered}%{@C}/{@H}%{_Size}%{@BC}] {@C}players! {@C}Waiting {@BC}[{@H}5{@BC}] {@H}seconds {@C}to scatter {@BC}[{@H}{@ScaTimes}{@BC}] {@C}more players!"
- else:
- broadcast "{@P}{@C} Scattered {@BC}[{@H}%{_Scattered}%{@C}/{@H}%{_Size}%{@BC}] {@C}players! {@C}Waiting {@BC}[{@H}5{@BC}] {@H}seconds {@C}to scatter {@BC}[{@H}%{_Size2}%{@BC}] {@C}more players!"
- command "/scattersound"
- set {_TPSStartTime} to now
- loop 5 times:
- wait 20 ticks
- if {@Butcher} is true:
- player command "/killall monsters"
- set {_TPSEndTime} to now
- set {_TPSTimeDifference} to difference between {_TPSStartTime} and now
- set {_parsedText} to ("%{_TPSTimeDifference}%" parsed as text)
- replace all " seconds" in {_parsedText} with ""
- set {_TPSTime} to ("%{_parsedText}%" parsed as number)
- set {_tps} to (100/{_TPSTime})
- loop all entities in the player's world:
- add 1 to {_entites}
- if {_tps} is greater than 17.5:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &a%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &aGOOD{@BC}, {@C}but still watch it!" to all ops for 20, 60, 20
- else if {_tps} is greater than 15:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &e%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &eOK{@BC}, {@H}disabling {@C}mob spawning!" to all ops for 20, 60, 20
- player command "/gamerule doMobSpawning false"
- else if {_tps} is greater than 10:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &cBAD{@BC}, {@H}killing ALL {@C}mobs!" to all ops for 20, 60, 20
- player command "/killall all"
- else if {_tps} is greater than 1:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems to be &4SUFFERING!{@BC}, {@C}contact a {@H}Head-Host/Admin NOW!" to all ops for 20, 60, 20
- player command "/killall all"
- else:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &cERROR!" and "{@C}Couldn't get the {@H}TPS/memory reading!" to all ops for 20, 60, 20
- wait 1 tick
- if {Scatter.Cancel} is not set:
- broadcast ""
- broadcast "{@P}{@C} A total of {@BC}[{@H}%{_Scattered}%{@BC}] {@C}players scattered! Took {@H}%difference between {_Time} and now%!"
- broadcast "{@P}{@C} Lowest Mindist{@BC}: {@H}%{_Mindist}%{@C} Radius{@BC}: {@H}%arg-2%"
- broadcast "{@P}{@C} Chunk Loading Ticks{@BC}: {@H}%{_ChunkLoadTicks}%{@C} Scatter Ticks{@BC}: {@H}%{_ScatterTicks}%"
- broadcast "{@P}{@C} If you are stuck in a block, use {@H}/fix! {@C}Disabling the command in {@BC}[{@H}30{@BC}] {@H}seconds!"
- teleport command sender to {_CMDSender}
- set {_TPSStartTime} to now
- loop 5 times:
- wait 20 ticks
- if {@Butcher} is true:
- player command "/killall monsters"
- set {_TPSEndTime} to now
- set {_TPSTimeDifference} to difference between {_TPSStartTime} and now
- set {_parsedText} to ("%{_TPSTimeDifference}%" parsed as text)
- replace all " seconds" in {_parsedText} with ""
- set {_TPSTime} to ("%{_parsedText}%" parsed as number)
- set {_tps} to (100/{_TPSTime})
- loop all entities in the player's world:
- add 1 to {_entites}
- if {_tps} is greater than 17.5:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &a%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &aGOOD{@BC}, {@C}but still watch it!" to all ops for 20, 60, 20
- else if {_tps} is greater than 15:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &e%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &eOK{@BC}, {@H}disabling {@C}mob spawning!" to all ops for 20, 60, 20
- player command "/gamerule doMobSpawning false"
- else if {_tps} is greater than 10:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &cBAD{@BC}, {@H}killing ALL {@C}mobs!" to all ops for 20, 60, 20
- player command "/killall all"
- else if {_tps} is greater than 1:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems to be &4SUFFERING!{@BC}, {@C}contact a {@H}Head-Host/Admin NOW!" to all ops for 20, 60, 20
- player command "/killall all"
- else:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &cERROR!" and "{@C}Couldn't get the {@H}TPS/memory reading!" to all ops for 20, 60, 20
- send "{@P}{@C} Killing all {@H}hostile mobs {@C}for {@BC}[{@H}1{@BC}] {@H}minute!" to all ops
- wait 1 tick
- set {Scatter.Fix} to true
- if {@Sounds} is true:
- loop all players:
- command "/playsound note.pling %loop-player%"
- loop 10 times:
- player command "/killall monsters"
- wait 1 second
- send "{@P}{@C} &cEnabling {@C}mob spawning, still {@H}butchering!" to all ops
- if {@Vanish} is true:
- command "/invis off"
- broadcast "{@P}{@H} Reappearing {@C}everyone! {@H}/Fix {@C}will be &cdisabled {@C}in {@BC}[{@H}15{@BC}] {@H}seconds!"
- player command "/gamerule doMobSpawning true"
- delete {Scatter.Scattering::*}
- delete {Scatter.DontUnloadChunks}
- loop 15 times:
- player command "/killall monsters"
- wait 1 second
- delete {Scatter.Fix}
- broadcast "{@P}{@H} /Fix {@C}is now &cdisabled{@BC}, {@C}don't try to use it!"
- set {_TPSStartTime} to now
- loop 5 times:
- wait 20 ticks
- if {@Butcher} is true:
- player command "/killall monsters"
- set {_TPSEndTime} to now
- set {_TPSTimeDifference} to difference between {_TPSStartTime} and now
- set {_parsedText} to ("%{_TPSTimeDifference}%" parsed as text)
- replace all " seconds" in {_parsedText} with ""
- set {_TPSTime} to ("%{_parsedText}%" parsed as number)
- set {_tps} to (100/{_TPSTime})
- loop all entities in the player's world:
- add 1 to {_entites}
- if {_tps} is greater than 17.5:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &a%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &aGOOD{@BC}, {@C}but still watch it!" to all ops for 20, 60, 20
- else if {_tps} is greater than 15:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &e%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &eOK{@BC}, {@H}disabling {@C}mob spawning!" to all ops for 20, 60, 20
- player command "/gamerule doMobSpawning false"
- else if {_tps} is greater than 10:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &cBAD{@BC}, {@H}killing ALL {@C}mobs!" to all ops for 20, 60, 20
- player command "/killall all"
- else if {_tps} is greater than 1:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems to be &4SUFFERING!{@BC}, {@C}contact a {@H}Head-Host/Admin NOW!" to all ops for 20, 60, 20
- player command "/killall all"
- else:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &cERROR!" and "{@C}Couldn't get the {@H}TPS/memory reading!" to all ops for 20, 60, 20
- delete {Scatter.DontUnloadChunks}
- delete {Scatter.Scattering::*}
- delete {Scatter.Fix}
- delete {Scatter.Cancel}
- delete {Invis::*}
- delete {Scatter.Scattering}
- command "/invis off"
- #--------------------------------------------------#
- # Team + Solo Scatter #
- #--------------------------------------------------#
- else if arg-3 is "team" or "teams":
- if command sender is console:
- stop trigger
- set {_Count} to 0
- set {Scatter.Scattering} to true
- loop {Teams::*}:
- {Team.%loop-value%::*} is set
- increase {_Count} by 1
- add {_Count} to {_TeamsToScatter::*}
- set {_TeamScatter.%{_Count}%::*} to ({Team.%loop-value%::*})
- loop all players:
- {Teams.InTeam::%loop-player%} is not set
- add loop-player to {_Solos::*}
- loop all players:
- {@SpecVariable} is true
- remove loop-player from {_Solos::*}
- set {_TeamSize} to (size of {Teams::*})
- set {_SoloSize} to (size of {_Solos::*})
- set {_TeamSize2} to (size of {Teams::*})
- set {_SoloSize2} to (size of {_Solos::*})
- set {_Size} to ((size of {Teams::*})+(size of {_Solos::*}))
- if arg-4 is set:
- if arg-4 is equal to 0:
- set {_Mindist} to (((arg-2 * 2) - 250)/{_Size})*3.5
- if arg-2 is less than {_Mindist}:
- set {_Mindist} to argument 2-100
- else if arg-2 is less than 1:
- set {_Mindist} to argument 2-100
- else:
- set {_Mindist} to arg-4
- else:
- set {_Mindist} to (((arg-2 * 2) - 250)/{_Size})*3.5
- if arg-2 is less than {_Mindist}:
- set {_Mindist} to argument 2-100
- else if arg-2 is less than 1:
- set {_Mindist} to argument 2-100
- if arg-5 is set:
- set {_X} to arg-5
- else:
- set {_X} to 0
- if arg-6 is set:
- set {_Z} to arg-6
- else:
- set {_Z} to 0
- if arg-7 is set:
- set {_ChunkLoadTicks} to arg-7
- else:
- set {_ChunkLoadTicks} to round({@UnitRateChunks}/{@UnitRatePlayers}*{_Size})
- if arg-8 is set:
- set {_ScatterTicks} to arg-8
- else:
- set {_ScatterTicks} to round({@UnitRateScatter}/{@UnitRatePlayers}*{_Size})
- if {_ChunkLoadTicks} is 0:
- set {_ChunkLoadTicks} to 1
- if {_ScatterTicks} is 0:
- set {_ScatterTicks} to 1
- set {_CMDLocB} to (location at (0, 256, 0) of the world arg-1)
- while (block at {_CMDLocB}) is air:
- set {_CMDLocB} to location 1 below {_CMDLocB}
- if y-coordinate of {_CMDLocB} is less than 3:
- set {_CMDLocB} to (location at (0, 256, 0) of the world arg-1)
- wait 1 tick
- teleport the command sender to (location 1 above {_CMDLocB})
- if {@MobSpawning} is false:
- player command "/gamerule doMobSpawning false"
- set {_ApproxTime} to ({_Size}*({_ChunkLoadTicks}+{_ScatterTicks})/20)+(({_Size}/{@ScaTimes})*5)+3
- broadcast "{@P}{@C} Attempting to scatter {@BC}[{@H}%{_TeamSize}%{@BC}]{@C} teams & {@BC}[{@H}%{_SoloSize}%{@BC}] {@C}solos around {@H}%{_X}%,%{_Z}%!"
- command "/scattersound"
- wait 2 ticks
- broadcast "{@P}{@C} Lowest Mindist{@BC}: {@H}%{_Mindist}%{@C} Radius{@BC}: {@H}%arg-2%"
- command "/scattersound"
- wait 2 ticks
- broadcast "{@P}{@C} Chunk Loading Ticks{@BC}: {@H}%{_ChunkLoadTicks}%{@C} Scatter Ticks{@BC}: {@H}%{_ScatterTicks}%"
- command "/scattersound"
- wait 2 ticks
- broadcast "{@P}{@C} This operation will take approximately {@H}%{_ApproxTime}% seconds!"
- command "/scattersound"
- loop ({_Size}) times:
- if {Scatter.Cancel} is true:
- exit loop
- loop {@Tries} times:
- if (loop-number-2) is {@Tries}:
- set {_Mindist} to 200
- loop ({_Size}) times:
- loop {@Tries} times:
- if (loop-number-2) is {@Tries}:
- broadcast "{@P}{@C}Couldn't scatter {@BC}[{@H}%({_Size})-(loop-number-1)%{@BC}/{@H}%{_Size}%{@BC}]{@C} players!"
- send "{@P} {@C}Locations couldn't be found! {@BC}[{@C}Too big of a {@H}mindist!{@BC}]"
- send "{@P} {@C}You may want to do {@H}/tpall!"
- command "/scatterbroke"
- stop trigger
- set {_Location.Good} to true
- set {_Location.Sky} to (the location at (random integer between ({_X}-arg-2) and ({_X}+arg-2)), 255, (random integer between ({_Z}-arg-2) and ({_Z}+arg-2)) of the world (arg-1))
- loop ((loop-number-1)-1) times:
- (distance between {_Location.Sky} and {_GoodLocation.Sky::%loop-number-3%}) is less than ({_Mindist})
- delete {_Location.Good}
- if {_Location.Good} is true:
- set {_Location.GroundLevel} to {_Location.Sky}
- while (block at {_Location.GroundLevel}) is air:
- if (y-coordinate of ({_Location.GroundLevel})) is less than 4:
- delete {_Location.Good}
- exit loop
- set {_Location.GroundLevel} to (location 1 below ({_Location.GroundLevel}))
- if {_Location.Good} is true:
- if (block at {_Location.GroundLevel}) is lava, water or cactus:
- delete {_Location.Good}
- else:
- set {_GoodLocation.Sky::%loop-number-1%} to ({_Location.Sky})
- set {_GoodLocation.GroundLevel::%loop-number-1%} to (location 1 above {_Location.GroundLevel})
- wait 1 tick
- exit 9 sections
- set {_Location.Good} to true
- set {_Location.Sky} to (the location at (random integer between ({_X}-arg-2) and ({_X}+arg-2)), 255, (random integer between ({_Z}-arg-2) and ({_Z}+arg-2)) of the world (arg-1))
- loop ((loop-number-1)-1) times:
- (distance between {_Location.Sky} and {_GoodLocation.Sky::%loop-number-3%}) is less than ({_Mindist})
- delete {_Location.Good}
- if {_Location.Good} is true:
- set {_Location.GroundLevel} to {_Location.Sky}
- while (block at {_Location.GroundLevel}) is air:
- if (y-coordinate of ({_Location.GroundLevel})) is less than 4:
- delete {_Location.Good}
- exit loop
- set {_Location.GroundLevel} to (location 1 below ({_Location.GroundLevel}))
- if {_Location.Good} is true:
- if (block at {_Location.GroundLevel}) is lava, water or cactus:
- delete {_Location.Good}
- else:
- set {_GoodLocation.Sky::%loop-number-1%} to ({_Location.Sky})
- set {_GoodLocation.GroundLevel::%loop-number-1%} to (location 1 above {_Location.GroundLevel})
- wait 1 tick
- exit loop
- if {@Vanish} is true:
- if {Scatter.Cancel} is not set:
- command "/invis on"
- if {Scatter.Cancel} is not set:
- set {Scatter.DontUnloadChunks} to true
- broadcast ""
- set {_Time} to now
- broadcast "{@P} {@C}Locations found! Starting the {@H}scatter {@C}process!"
- loop {_ToScatter::*}:
- set {Scatter.Scattering::%loop-value%} to true
- while {_TeamSize} is more than 0:
- if {Scatter.Cancel} is true:
- exit loop
- if {Teams::*} is not set:
- exit loop
- if {_TeamSize} is less than {@ScaTimes}+1:
- if {@LoadGeneratedChunks} is true:
- loop {_TeamSize} times:
- if command sender is not online:
- broadcast "{@P} {@C}Stopping {@H}scatter! {@C}Chunkloading player logged out."
- command "/scatterbroke"
- stop trigger
- add 1 to {_Chunks}
- teleport command sender to {_GoodLocation.GroundLevel::%{_Chunks}%}
- if {@SEMTAp} is true:
- send action bar from "{@C}Loading chunks {@BC}» {@BC}[{@H}%{_Chunks}%{@BC}/{@H}%{_Size}%{@BC}]" to all players
- if {@Butcher} is true:
- player command "/killall monsters"
- loop {_ChunkLoadTicks} times:
- wait 1 tick
- loop {_TeamSize} times:
- if {@LoadGeneratedChunks} is not true:
- if {@Butcher} is true:
- player command "/killall monsters"
- set {_Scatter.Team} to a random element out of {_TeamsToScatter::*}
- remove {_Scatter.Team} from {_TeamsToScatter::*}
- add 1 to {_Scattered}
- add 1 to {_TotalScattered}
- loop {_TeamScatter.%{_Scatter.Team}%::*}:
- set {_Scatter.Player} to ("%loop-value-2%" parsed as offlineplayer)
- if {_Scatter.Player} is not online:
- if {_Scatter.Player} is "%command sender%":
- set {_CMDSender} to {_GoodLocation.GroundLevel::%{_TotalScattered}%}
- if {@SEMTAp} is true:
- send action bar from "{@H}%{_Scatter.Player}% {@C}wasn't scattered, since he/she is the {@H}command sender!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_TeamSize2}%{@BC}] {@C}teams!" to all players
- else:
- set {SchedueldScatter::%{_Scatter.Player}%} to ({_GoodLocation.GroundLevel::%{_TotalScattered}%})
- if {@SEMTAp} is true:
- send action bar from "{@P}&4&lOFFLINE {@BC}- {@H}%{_Scatter.Player}% {@C}scheduled to be {@H}scattered!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_TeamSize2}%{@BC}] {@C}teams!" to all players
- else:
- if {_Scatter.Player} is "%command sender%":
- set {_CMDSender} to {_GoodLocation.GroundLevel::%{_TotalScattered}%}
- if {@SEMTAp} is true:
- send action bar from "{@H}%{_Scatter.Player}% {@C}wasn't scattered, since he/she is the {@H}command sender!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_TeamSize2}%{@BC}] {@C}teams!" to all players
- else:
- teleport {_Scatter.Player} to ({_GoodLocation.GroundLevel::%{_TotalScattered}%})
- send title from "{@H}You {@C}were scattered!" and "{@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_TeamSize2}%{@BC}]" to {_Scatter.Player} for 20, 20, 20
- if {@SEMTAp} is true:
- send action bar from "{@H}%{_Scatter.Player}% {@C}was scattered!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_TeamSize2}%{@BC}] {@C}teams!" to all players
- loop {_ScatterTicks} times:
- wait 1 tick
- set {_TeamSize} to 0
- exit loop
- else:
- if {@LoadGeneratedChunks} is true:
- loop {@ScaTimes} times:
- if command sender is not online:
- broadcast "{@P} {@C}Stopping {@H}scatter! {@C}Chunkloading player logged out."
- command "/scatterbroke"
- stop trigger
- add 1 to {_Chunks}
- teleport command sender to {_GoodLocation.GroundLevel::%{_Chunks}%}
- if {@SEMTAp} is true:
- send action bar from "{@C}Loading chunks {@BC}» {@BC}[{@H}%{_Chunks}%{@BC}/{@H}%{_Size}%{@BC}]" to all players
- if {@Butcher} is true:
- player command "/killall monsters"
- loop {_ChunkLoadTicks} times:
- wait 1 tick
- loop {@ScaTimes} times:
- if {@LoadGeneratedChunks} is not true:
- if {@Butcher} is true:
- player command "/killall monsters"
- set {_Scatter.Team} to a random element out of {_TeamsToScatter::*}
- remove {_Scatter.Team} from {_TeamsToScatter::*}
- remove 1 from {_TeamSize}
- add 1 to {_Scattered}
- add 1 to {_TotalScattered}
- loop {_TeamScatter.%{_Scatter.Team}%::*}:
- set {_Scatter.Player} to ("%loop-value-2%" parsed as offlineplayer)
- if {_Scatter.Player} is not online:
- if {_Scatter.Player} is "%command sender%":
- set {_CMDSender} to {_GoodLocation.GroundLevel::%{_TotalScattered}%}
- if {@SEMTAp} is true:
- send action bar from "{@H}%{_Scatter.Player}% {@C}wasn't scattered, since he/she is the {@H}command sender!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_TeamSize2}%{@BC}] {@C}teams!" to all players
- else:
- set {SchedueldScatter::%{_Scatter.Player}%} to ({_GoodLocation.GroundLevel::%{_TotalScattered}%})
- if {@SEMTAp} is true:
- send action bar from "{@P}&4&lOFFLINE {@BC}- {@H}%{_Scatter.Player}% {@C}scheduled to be {@H}scattered!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_TeamSize2}%{@BC}] {@C}teams!" to all players
- else:
- if {_Scatter.Player} is "%command sender%":
- set {_CMDSender} to {_GoodLocation.GroundLevel::%{_TotalScattered}%}
- if {@SEMTAp} is true:
- send action bar from "{@H}%{_Scatter.Player}% {@C}wasn't scattered, since he/she is the {@H}command sender!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_TeamSize2}%{@BC}] {@C}teams!" to all players
- else:
- teleport {_Scatter.Player} to ({_GoodLocation.GroundLevel::%{_TotalScattered}%})
- send title from "{@H}You {@C}were scattered!" and "{@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_TeamSize2}%{@BC}]" to {_Scatter.Player} for 20, 20, 20
- if {@SEMTAp} is true:
- send action bar from "{@P}{@H} %{_Scatter.Player}% {@C}was scattered!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_TeamSize2}%{@BC}] {@C}teams!" to all players
- loop {_ScatterTicks} times:
- wait 1 tick
- if {_TeamSize} is more than 9:
- broadcast "{@P}{@C} Scattered {@BC}[{@H}%{_Scattered}%{@C}/{@H}%{_TeamSize2}%{@BC}] {@C}teams! {@C}Waiting {@BC}[{@H}7{@BC}] {@H}seconds {@C}to scatter {@BC}[{@H}10{@BC}] {@C}more teams!"
- else:
- broadcast "{@P}{@C} Scattered {@BC}[{@H}%{_Scattered}%{@C}/{@H}%{_TeamSize2}%{@BC}] {@C}teams! {@C}Waiting {@BC}[{@H}7{@BC}] {@H}seconds {@C}to scatter {@BC}[{@H}%{_TeamSize}%{@BC}] {@C}more teams!"
- command "/scattersound"
- set {_TPSStartTime} to now
- loop 5 times:
- wait 20 ticks
- if {@Butcher} is true:
- player command "/killall monsters"
- set {_TPSEndTime} to now
- set {_TPSTimeDifference} to difference between {_TPSStartTime} and now
- set {_parsedText} to ("%{_TPSTimeDifference}%" parsed as text)
- replace all " seconds" in {_parsedText} with ""
- set {_TPSTime} to ("%{_parsedText}%" parsed as number)
- set {_tps} to (100/{_TPSTime})
- loop all entities in the player's world:
- add 1 to {_entites}
- if {_tps} is greater than 17.5:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &a%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &aGOOD{@BC}, {@C}but still watch it!" to all ops for 20, 60, 20
- else if {_tps} is greater than 15:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &e%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &eOK{@BC}, {@H}disabling {@C}mob spawning!" to all ops for 20, 60, 20
- player command "/gamerule doMobSpawning false"
- else if {_tps} is greater than 10:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &cBAD{@BC}, {@H}killing ALL {@C}mobs!" to all ops for 20, 60, 20
- player command "/killall all"
- else if {_tps} is greater than 1:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems to be &4SUFFERING!{@BC}, {@C}contact a {@H}Head-Host/Admin NOW!" to all ops for 20, 60, 20
- player command "/killall all"
- else:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &cERROR!" and "{@C}Couldn't get the {@H}TPS/memory reading!" to all ops for 20, 60, 20
- loop 2 times:
- wait 1 second
- if {@Butcher} is true:
- player command "/killall monsters"
- if {Teams::*} is set:
- if {Scatter.Cancel} is not set:
- broadcast "{@P}{@C} Scattered {@BC}[{@H}%{_Scattered}%{@C}/{@H}%{_TeamSize2}%{@BC}] {@C}teams! {@C}Waiting {@BC}[{@H}5{@BC}] {@H}seconds {@C}to scatter solo players!"
- command "/scattersound"
- loop 5 times:
- wait 1 second
- if {@Butcher} is true:
- player command "/killall monsters"
- set {_Scattered.Teams} to {_Scattered}
- set {_Scattered} to 0
- while {_SoloSize} is more than 0:
- if {Scatter.Cancel} is true:
- exit loop
- if {_Solos::*} is not set:
- exit loop
- if {_SoloSize} is less than {@ScaTimes}+1:
- if {@LoadGeneratedChunks} is true:
- loop {_SoloSize} times:
- if command sender is not online:
- broadcast "{@P} {@C}Stopping {@H}scatter! {@C}Chunkloading player logged out."
- command "/scatterbroke"
- stop trigger
- add 1 to {_Chunks}
- teleport command sender to {_GoodLocation.GroundLevel::%{_Chunks}%}
- if {@SEMTAp} is true:
- send action bar from "{@C}Loading chunks {@BC}» {@BC}[{@H}%{_Chunks}%{@BC}/{@H}%{_Size}%{@BC}]" to all players
- if {@Butcher} is true:
- player command "/killall monsters"
- loop {_ChunkLoadTicks} times:
- wait 1 tick
- loop {_SoloSize} times:
- if {@LoadGeneratedChunks} is not true:
- if {@Butcher} is true:
- player command "/killall monsters"
- set {_Scatter.Player} to a random element out of {_Solos::*}
- set {_Scatter.Player} to {_Scatter.Player} parsed as offlineplayer
- remove {_Scatter.Player} from {_Solos::*}
- add 1 to {_Scattered}
- add 1 to {_TotalScattered}
- if {_Scatter.Player} is not online:
- if {_Scatter.Player} is "%command sender%":
- set {_CMDSender} to {_GoodLocation.GroundLevel::%{_TotalScattered}%}
- if {@SEMTAp} is true:
- send action bar from "{@H}%{_Scatter.Player}% {@C}wasn't scattered, since he/she is the {@H}command sender!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_SoloSize2}%{@BC}] {@C}solo players!" to all players
- else:
- set {SchedueldScatter::%{_Scatter.Player}%} to ({_GoodLocation.GroundLevel::%{_TotalScattered}%})
- if {@SEMTAp} is true:
- send action bar from "&4&lOFFLINE {@BC}- {@H}%{_Scatter.Player}% {@C}scheduled to be {@H}scattered!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_SoloSize2}%{@BC}] {@C}solo players!" to all players
- else:
- if {_Scatter.Player} is "%command sender%":
- set {_CMDSender} to {_GoodLocation.GroundLevel::%{_TotalScattered}%}
- if {@SEMTAp} is true:
- send action bar from "{@H}%{_Scatter.Player}% {@C}wasn't scattered, since he/she is the {@H}command sender!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_SoloSize2}%{@BC}] {@C}solo players!" to all players
- else:
- teleport {_Scatter.Player} to ({_GoodLocation.GroundLevel::%{_TotalScattered}%})
- send title from "{@H}You {@C}were scattered!" and "{@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_SoloSize2}%{@BC}]" to {_Scatter.Player} for 20, 20, 20
- if {@SEMTAp} is true:
- send action bar from "{@H}%{_Scatter.Player}% {@C}was scattered!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_SoloSize2}%{@BC}] {@C}solo players!" to all players
- loop {_ScatterTicks} times:
- wait 1 tick
- set {_SoloSize} to 0
- exit loop
- else:
- if {@LoadGeneratedChunks} is true:
- loop {@ScaTimes} times:
- if command sender is not online:
- broadcast "{@P} {@C}Stopping {@H}scatter! {@C}Chunkloading player logged out."
- command "/scatterbroke"
- stop trigger
- add 1 to {_Chunks}
- teleport command sender to {_GoodLocation.GroundLevel::%{_Chunks}%}
- if {@SEMTAp} is true:
- send action bar from "{@C}Loading chunks {@BC}» {@BC}[{@H}%{_Chunks}%{@BC}/{@H}%{_Size}%{@BC}]" to all players
- if {@Butcher} is true:
- player command "/killall monsters"
- loop {_ChunkLoadTicks} times:
- wait 1 tick
- loop {@ScaTimes} times:
- if {@LoadGeneratedChunks} is not true:
- if {@Butcher} is true:
- player command "/killall monsters"
- set {_Scatter.Player} to a random element out of {_Solos::*}
- set {_Scatter.Player} to {_Scatter.Player} parsed as offlineplayer
- remove {_Scatter.Player} from {_Solos::*}
- remove 1 from {_SoloSize}
- add 1 to {_Scattered}
- add 1 to {_TotalScattered}
- if {_Scatter.Player} is not online:
- if {_Scatter.Player} is "%command sender%":
- set {_CMDSender} to {_GoodLocation.GroundLevel::%{_TotalScattered}%}
- if {@SEMTAp} is true:
- send action bar from "{@H}%{_Scatter.Player}% {@C}wasn't scattered, since he/she is the {@H}command sender!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_SoloSize2}%{@BC}] {@C}solo players!" to all players
- else:
- set {SchedueldScatter::%{_Scatter.Player}%} to ({_GoodLocation.GroundLevel::%{_TotalScattered}%})
- if {@SEMTAp} is true:
- send action bar from "&4&lOFFLINE {@BC}- {@H}%{_Scatter.Player}% {@C}scheduled to be {@H}scattered!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_SoloSize2}%{@BC}] {@C}solo players!" to all players
- else:
- if {_Scatter.Player} is "%command sender%":
- set {_CMDSender} to {_GoodLocation.GroundLevel::%{_TotalScattered}%}
- if {@SEMTAp} is true:
- send action bar from "{@H}%{_Scatter.Player}% {@C}wasn't scattered, since he/she is the {@H}command sender!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_SoloSize2}%{@BC}] {@C}solo players!" to all players
- else:
- teleport {_Scatter.Player} to ({_GoodLocation.GroundLevel::%{_TotalScattered}%})
- send title from "{@H}You {@C}were scattered!" and "{@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_SoloSize2}%{@BC}]" to {_Scatter.Player} for 20, 20, 20
- if {@SEMTAp} is true:
- send action bar from "{@H}%{_Scatter.Player}% {@C}was scattered!{@C} Scattered {@BC}[{@H}%{_Scattered}%{@BC}/{@H}%{_SoloSize2}%{@BC}] {@C}solo players!" to all players
- loop {_ScatterTicks} times:
- wait 1 tick
- if {_SoloSize} is more than {@ScaTimes}:
- broadcast "{@P}{@C} Scattered {@BC}[{@H}%{_Scattered}%{@C}/{@H}%{_SoloSize2}%{@BC}] {@C}solo players! {@C}Waiting {@BC}[{@H}5{@BC}] {@H}seconds {@C}to scatter {@BC}[{@H}{@ScaTimes}{@BC}] {@C}more solo players!"
- else:
- broadcast "{@P}{@C} Scattered {@BC}[{@H}%{_Scattered}%{@C}/{@H}%{_SoloSize2}%{@BC}] {@C}solo players! {@C}Waiting {@BC}[{@H}5{@BC}] {@H}seconds {@C}to scatter {@BC}[{@H}%{_SoloSize}%{@BC}] {@C}more solo players!"
- command "/scattersound"
- set {_TPSStartTime} to now
- loop 5 times:
- wait 20 ticks
- if {@Butcher} is true:
- player command "/killall monsters"
- set {_TPSEndTime} to now
- set {_TPSTimeDifference} to difference between {_TPSStartTime} and now
- set {_parsedText} to ("%{_TPSTimeDifference}%" parsed as text)
- replace all " seconds" in {_parsedText} with ""
- set {_TPSTime} to ("%{_parsedText}%" parsed as number)
- set {_tps} to (100/{_TPSTime})
- loop all entities in the player's world:
- add 1 to {_entites}
- if {_tps} is greater than 17.5:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &a%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &aGOOD{@BC}, {@C}but still watch it!" to all ops for 20, 60, 20
- else if {_tps} is greater than 15:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &e%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &eOK{@BC}, {@H}disabling {@C}mob spawning!" to all ops for 20, 60, 20
- player command "/gamerule doMobSpawning false"
- else if {_tps} is greater than 10:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &cBAD{@BC}, {@H}killing ALL {@C}mobs!" to all ops for 20, 60, 20
- player command "/killall all"
- else if {_tps} is greater than 1:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems to be &4SUFFERING!{@BC}, {@C}contact a {@H}Head-Host/Admin NOW!" to all ops for 20, 60, 20
- player command "/killall all"
- else:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &cERROR!" and "{@C}Couldn't get the {@H}TPS/memory reading!" to all ops for 20, 60, 20
- wait 1 tick
- if {Scatter.Cancel} is not set:
- set {_Scattered.Solos} to {_Scattered}
- if {Teams::*} is not set:
- set {_Scattered.Teams} to 0
- broadcast ""
- broadcast "{@P}{@C} A total of {@BC}[{@H}%{_Scattered.Teams}%{@BC}] {@H}teams & {@BC}[{@H}%{_Scattered.Solos}%{@BC}] {@H}solos {@C}scattered! Took {@H}%difference between {_Time} and now%!"
- broadcast "{@P}{@C} Lowest Mindist{@BC}: {@H}%{_Mindist}%{@C} Radius{@BC}: {@H}%arg-2%"
- broadcast "{@P}{@C} Chunk Loading Ticks{@BC}: {@H}%{_ChunkLoadTicks}%{@C} Scatter Ticks{@BC}: {@H}%{_ScatterTicks}%"
- broadcast "{@P}{@C} If you are stuck in a block, use {@H}/fix! {@C}Disabling the command in {@BC}[{@H}30{@BC}] {@H}seconds!"
- teleport command sender to {_CMDSender}
- set {_TPSStartTime} to now
- loop 5 times:
- wait 20 ticks
- if {@Butcher} is true:
- player command "/killall monsters"
- set {_TPSEndTime} to now
- set {_TPSTimeDifference} to difference between {_TPSStartTime} and now
- set {_parsedText} to ("%{_TPSTimeDifference}%" parsed as text)
- replace all " seconds" in {_parsedText} with ""
- set {_TPSTime} to ("%{_parsedText}%" parsed as number)
- set {_tps} to (100/{_TPSTime})
- loop all entities in the player's world:
- add 1 to {_entites}
- if {_tps} is greater than 17.5:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &a%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &aGOOD{@BC}, {@C}but still watch it!" to all ops for 20, 60, 20
- else if {_tps} is greater than 15:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &e%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &eOK{@BC}, {@H}disabling {@C}mob spawning!" to all ops for 20, 60, 20
- player command "/gamerule doMobSpawning false"
- else if {_tps} is greater than 10:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &cBAD{@BC}, {@H}killing ALL {@C}mobs!" to all ops for 20, 60, 20
- player command "/killall all"
- else if {_tps} is greater than 1:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems to be &4SUFFERING!{@BC}, {@C}contact a {@H}Head-Host/Admin NOW!" to all ops for 20, 60, 20
- player command "/killall all"
- else:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &cERROR!" and "{@C}Couldn't get the {@H}TPS/memory reading!" to all ops for 20, 60, 20
- send "{@P}{@C} Killing all {@H}hostile mobs {@C}for {@BC}[{@H}1{@BC}] {@H}minute!" to all ops
- wait 1 tick
- set {Scatter.Fix} to true
- if {@Sounds} is true:
- loop all players:
- command "/playsound note.pling %loop-player%"
- loop 10 times:
- player command "/killall monsters"
- wait 1 second
- send "{@P}{@C} &cEnabling {@C}mob spawning, still {@H}butchering!"
- if {@Vanish} is true:
- command "/invis off"
- broadcast "{@P}{@H} Reappearing {@C}everyone! {@H}/Fix {@C}will be &cdisabled {@C}in {@BC}[{@H}15{@BC}] {@H}seconds!"
- player command "/gamerule doMobSpawning true"
- delete {Scatter.Scattering::*}
- delete {Scatter.DontUnloadChunks}
- loop 15 times:
- player command "/killall monsters"
- wait 1 second
- delete {Scatter.Fix}
- broadcast "{@P}{@H} /Fix {@C}is now &cdisabled{@BC}, {@C}don't try to use it!"
- set {_TPSStartTime} to now
- loop 5 times:
- wait 20 ticks
- if {@Butcher} is true:
- player command "/killall monsters"
- set {_TPSEndTime} to now
- set {_TPSTimeDifference} to difference between {_TPSStartTime} and now
- set {_parsedText} to ("%{_TPSTimeDifference}%" parsed as text)
- replace all " seconds" in {_parsedText} with ""
- set {_TPSTime} to ("%{_parsedText}%" parsed as number)
- set {_tps} to (100/{_TPSTime})
- if {_tps} is greater than 17.5:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &a%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &aGOOD{@BC}, {@C}but still watch it!" to all ops for 20, 60, 20
- else if {_tps} is greater than 15:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &e%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &eOK{@BC}, {@H}disabling {@C}mob spawning!" to all ops for 20, 60, 20
- player command "/gamerule doMobSpawning false"
- else if {_tps} is greater than 10:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems &cBAD{@BC}, {@H}killing ALL {@C}mobs!" to all ops for 20, 60, 20
- player command "/killall all"
- else if {_tps} is greater than 1:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &c%{_tps}%!" and "{@C}Your {@H}TPS/Memory {@C}seems to be &4SUFFERING!{@BC}, {@C}contact a {@H}Head-Host/Admin NOW!" to all ops for 20, 60, 20
- player command "/killall all"
- else:
- if {@TPSR} is true:
- send title from "{@C}TPS {@BC}» &cERROR!" and "{@C}Couldn't get the {@H}TPS/memory reading!" to all ops for 20, 60, 20
- delete {Scatter.DontUnloadChunks}
- delete {Scatter.Scattering::*}
- delete {Scatter.Fix}
- delete {Scatter.Cancel}
- delete {Invis::*}
- delete {Scatter.Scattering}
- command "/invis off"
- #--------------------------------------------------#
- # Single Player Scatter #
- #--------------------------------------------------#
- else if ("%arg-3%" parsed as offlineplayer) is online:
- loop {@Tries} times:
- if (loop-number-2) is {@Tries}:
- broadcast "{@P}{@C} Could not scatter {@H}%arg-3%!"
- send "{@P}{@C} Try lowering the {@H}mindist!"
- command "/scatterbroke"
- stop trigger
- set {_Location.Good} to true
- set {_Location.Sky} to (the location at (random integer between ({_X}-arg-2) and ({_X}+arg-2)), 255, (random integer between ({_Z}-arg-2) and ({_Z}+arg-2)) of the world (arg-1))
- if {_Location.Good} is true:
- set {_Location.GroundLevel} to {_Location.Sky}
- while (block at {_Location.GroundLevel}) is air:
- if (y-coordinate of ({_Location.GroundLevel})) is less than 4:
- delete {_Location.Good}
- stop loop
- set {_Location.GroundLevel} to (location 1 below ({_Location.GroundLevel}))
- if {_Location.Good} is true:
- if (block at {_Location.GroundLevel}) is lava, water or cactus:
- delete {_Location.Good}
- else:
- set {_GoodLocation.Sky} to ({_Location.Sky})
- set {_GoodLocation.GroundLevel} to (location 1 above {_Location.GroundLevel})
- stop loop
- set {Scattering::%arg-3%} to true
- teleport ("%arg-3%" parsed as offlineplayer) to ({_GoodLocation.GroundLevel})
- send title from "{@H}You {@C}were scattered!" and "{@BC}[{@H}1{@BC}/{@H}1{@BC}]" to ("%arg-3%" parsed as offlineplayer) for 20, 20, 20
- send "{@P} {@BC}- {@H}%arg-3%{@C} Scattered." to all ops
- wait 1 second
- delete {Scatter.Scattering::%arg-3%}
- #--------------------------------------------------#
- # Invisible Command #
- # Thank you Cam for making this! #
- #--------------------------------------------------#
- command /invis [<text=toggle>]:
- permission: {@Permission}
- trigger:
- if arg-1 is "on" or "enable":
- set {invis} to true
- loop all players:
- command "/van %loop-player%"
- add loop-player to {Invis::*}
- else if arg-1 is "off" or "disable":
- delete {invis}
- loop {Invis::*}:
- command "/rea %loop-value%"
- remove loop-value from {Invis::*}
- else if arg-1 is "toggle":
- if {invis} is set:
- delete {invis}
- loop {Invis::*}:
- command "/rea %loop-value%"
- remove loop-value from {Invis::*}
- else:
- set {invis} to true
- loop all players:
- command "/van %loop-player%"
- add loop-player to {Invis::*}
- #--------------------------------------------------#
- # Scatter Sound Commands #
- #--------------------------------------------------#
- command /scattersound:
- permission: {@Permission}
- trigger:
- {@Sounds} is true
- loop all players:
- command "/playsound {@ScatterSound} %loop-player% ~ ~ ~ 1 0.5 1"
- command /scatterbroke:
- permission: {@Permission}
- trigger:
- {@Sounds} is true
- loop all players:
- command "/playsound random.break %loop-player%"
- #--------------------------------------------------#
- # Cancel Scatter Command #
- #--------------------------------------------------#
- #command /cancelscatter:
- # permission: {@Permission}
- # aliases: /cancelsca, /csca, /scattercancel
- # trigger:
- # if {Scatter.Scattering} is set:
- # set {Scatter.Cancel} to true
- # delete {Scatter.DontUnloadChunks}
- # delete {Scatter.Scattering::*}
- # delete {Scatter.Fix}
- # delete {Invis::*}
- # broadcast "{@P}{@C} The scatter has been cancelled by {@H}%command sender%!"
- # command "/scatterbroke"
- # command "/invis off"
- # send "{@P}{@C} The scatter will stop within a few {@H}seconds!"
- # send "{@P}{@C} You may want to {@H}/tpall!"
- # else:
- # send "{@P}{@C} There is no {@H}scatter {@C}running!"
- #--------------------------------------------------#
- # Miscellaneous Things #
- #--------------------------------------------------#
- on join:
- {invis} is true
- command "/van %event-player%"
- add event-player to {Invis::*}
- on disconnect:
- {Invis::%event-player%} is set
- command "/rea %event-player%"
- on skript load:
- delete {Scatter.DontUnloadChunks}
- delete {Scatter.Scattering::*}
- delete {Scatter.Fix}
- delete {Scatter.Cancel}
- delete {Scatter.Scattering}
- delete {Invis::*}
- broadcast "{@P}{@C} Thanks for installing {@H}Nate's scatter version {@BC}[{@H}{@Version}{@BC}]!"
- broadcast "{@P}{@C} If you have any questions, tweet at {@H}@NatePlaysUHC!"
- broadcast "{@P}{@C} Want to see the {@H}scatter {@C}in action, follow {@H}@OblivionUHC {@C}on {@H}twitter!"
- on login:
- delete {Scatter.Scattering::%player%}
- if {SchedueldScatter::%player%} is set:
- teleport (player) to ({SchedueldScatter::%player%})
- delete {SchedueldScatter::%player%}
- send "{@P} {@BC}- {@H}%player% {@BC}- {@C}Late Scattered!" to all ops
- if {invis} is true:
- command "/van %event-player%"
- add event-player to {Invis::*}
- on chunk unload:
- {Scatter.DontUnloadChunks} is true
- cancel the event
- on damage of a player:
- {Scatter.Scattering::%victim%} is true
- cancel the event
- command /fix:
- trigger:
- if {Scatter.Fix} is set:
- set {_CMDLocB} to location of the command sender
- teleport the command sender to (location 1 above {_CMDLocB})
- send "{@P}{@C} You are now out of the {@H}block!"
- else:
- send "{@P}{@C} This command is {@H}disabled!"
- # Well you made it to the bottom
- # Hope you enjoyed the code.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement