Advertisement
Guest User

Untitled

a guest
Sep 17th, 2016
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.11 KB | None | 0 0
  1. #--------------------------------------------------#
  2. # Credits & things! #
  3. #--------------------------------------------------#
  4.  
  5. # Nate's scatter skript, version [4.3] by NatePlays
  6. # Skript 2.1 & Below Version (Not suggested to use this one)
  7. # Need help installing it? Contact me through twitter! (@NatePlaysUHC)
  8. # Want to see it in action before using it? Then follow @OblivionUHC on Twitter to play a game!
  9. # Thank you, Cam (Camaro6460), for making & letting me use the /invis part in the skript!
  10. # Feel free to send to anyone, just give the right credit!
  11. # Also, feel free to edit for your own use!
  12. # Used the same variables as Cam's & Midnight's (Guideless) scatter for easy customization!
  13. # Some parts of the skript are orginally NOT MINE
  14. # Other then that, hope you like it!
  15.  
  16. options:
  17.  
  18. #--------------------------------------------------#
  19. # Config/Options #
  20. #--------------------------------------------------#
  21.  
  22. P: &c&lScatter &8»
  23. # Prefix! Ex: (Prefix)&c&lScatter &8» (Main Chat Color)Everyone is now invisible!
  24.  
  25. C: &7
  26. # Main chat color! Ex: (Prefix)&c&lScatter &8» (Main Chat Color)The scatter is now (Highlight Chat Color)complete!
  27.  
  28. H: &c
  29. # Highlight chat color! Ex: (Prefix)&c&lScatter &8» (Highlight Chat Color)You (Main Chat Color)were scattered!
  30.  
  31. BC: &8
  32. # Bracket, colon, and etc. color, it is this "[]" and ":" in chat!
  33.  
  34. Permission: skript.scatter
  35. # The permission you give ops/hosts/staff/etc. to use all of the commands!
  36.  
  37. Sounds: true
  38. # Do you want sounds?
  39.  
  40. ScatterSound: random.pop
  41. # The main sound in the scatter!
  42.  
  43. Tries: 1001
  44. # I do not suggest changing this!
  45.  
  46. LoadGeneratedChunks: true
  47. # Ummm, load the generated chunks? This helps some people, other it does not, for me it does help! (Use "true" or "false")
  48.  
  49. Vanish: true
  50. # Vanish players while scattering? This helps tps on 90% of servers! (Use "true" or "false") **Requires SimpleVanish plugin**
  51.  
  52. Butcher: true
  53. # Butch mobs while scattering? If you have a problem, with /butcher, don't use this option! (Use "true" or "false") **Requires Worldedit & Worldguard plugin**
  54.  
  55. MobSpawning: true
  56. # Should mobs spawn while scattering? I suggest you set this to "true", but if you have horrible provider, like McProHosting set it to "false" (Use "true" or "false")
  57.  
  58. UnitRatePlayers: 100
  59. # The unit rate number in player amount!
  60. # 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,
  61. # so I would set this option to 100, the next to 10, and the one after that one to 1!
  62.  
  63. UnitRateChunks: 10
  64. # The amount of ticks between each chunk to be loaded with the unit rate!**Use Ticks**
  65. # 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,
  66. # so the chunkload player waits 20 ticks (1 second) before the chunkload player is teleported to the next chunk!
  67.  
  68. UnitRateScatter: 1
  69. # The amount of ticks between each player to be scattered with the unit rate! **Use Ticks**
  70. # 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,
  71. # so we wait 2 ticks, before the next player is scattered! (This does not effect the five second wait!)
  72.  
  73. ScaTimes: 10
  74. # The amount of players gets scattered, then you wait 5 seconds for the next amount of players to be scattered!
  75.  
  76. SpecVariable: {Spec::%loop-player%}
  77. # Your spectating variable, if you are using a skript, if your using a plugin then this is worthless, ignore it!
  78.  
  79.  
  80.  
  81. #--------------------------------------------------#
  82. # Main Command #
  83. #--------------------------------------------------#
  84.  
  85. command /sca [<world>] [<integer>] [<text>] [<integer>] [<integer>] [<integer>] [<integer>] [<integer>] :
  86. aliases: /teamsscatter, /scatterall, /teamscatter
  87. permission: {@Permission}
  88. trigger:
  89.  
  90. #--------------------------------------------------#
  91. # Arguments #
  92. #--------------------------------------------------#
  93.  
  94. if arg-1 is not set:
  95. 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}]"
  96. command "/playsound random.break %command sender% ~ ~ ~ 1 1 1"
  97. stop trigger
  98. else if arg-2 is not set:
  99. 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}]"
  100. command "/playsound random.break %command sender% ~ ~ ~ 1 1 1"
  101. stop trigger
  102. else if arg-3 is not set:
  103. 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}]"
  104. command "/playsound random.break %command sender% ~ ~ ~ 1 1 1"
  105. stop trigger
  106.  
  107. #--------------------------------------------------#
  108. # FFA/Solo Scatter #
  109. #--------------------------------------------------#
  110.  
  111. if arg-3 is "all" or "*":
  112. if command sender is console:
  113. stop trigger
  114. set {_ToScatter::*} to (all players)
  115. loop all players:
  116. {@SpecVariable} is true
  117. remove loop-player from {_ToScatter::*}
  118. set {_Size} to (size of {_ToScatter::*})
  119. if arg-4 is set:
  120. if arg-4 is equal to 0:
  121. set {_Mindist} to (arg-2/{_Size})*3.5
  122. if arg-2 is less than {_Mindist}:
  123. set {_Mindist} to argument 2-100
  124. else:
  125. set {_Mindist} to arg-4
  126. else:
  127. set {_Mindist} to (arg-2/{_Size})*3.5
  128. if arg-2 is less than {_Mindist}:
  129. set {_Mindist} to argument 2-100
  130. if arg-5 is set:
  131. set {_X} to arg-5
  132. else:
  133. set {_X} to 0
  134. if arg-6 is set:
  135. set {_Z} to arg-6
  136. else:
  137. set {_Z} to 0
  138. if arg-7 is set:
  139. set {_ChunkLoadTicks} to arg-7
  140. else:
  141. set {_ChunkLoadTicks} to round({@UnitRateChunks}/{@UnitRatePlayers}*{_Size})
  142. if arg-8 is set:
  143. set {_ScatterTicks} to arg-8
  144. else:
  145. set {_ScatterTicks} to round({@UnitRateScatter}/{@UnitRatePlayers}*{_Size})
  146. if {_ChunkLoadTicks} is 0:
  147. set {_ChunkLoadTicks} to 1
  148. if {_ScatterTicks} is 0:
  149. set {_ScatterTicks} to 1
  150. while (block at {_CMDLocB}) is air:
  151. set {_CMDLocB} to location 1 below {_CMDLocB}
  152. if y-coordinate of {_CMDLocB} is less than 3:
  153. set {_CMDLocB} to (location at (0, 256, 0) of the world arg-1)
  154. wait 1 tick
  155. teleport the command sender to (location 1 above {_CMDLocB})
  156. if {@MobSpawning} is false:
  157. player command "/gamerule doMobSpawning false"
  158. set {_ApproxTime} to ({_Size}*({_ChunkLoadTicks}+{_ScatterTicks})/20)+(({_Size}/{@ScaTimes})*5)
  159. broadcast "{@P}{@C} Attempting to scatter {@BC}[{@H}%{_Size}%{@C}{@BC}] {@C}players around {@H}%{_X}%,%{_Z}%!"
  160. command "/scattersound"
  161. wait 2 ticks
  162. broadcast "{@P}{@C} Lowest Mindist{@BC}: {@H}%{_Mindist}%{@C} Radius{@BC}: {@H}%arg-2%"
  163. command "/scattersound"
  164. wait 2 ticks
  165. broadcast "{@P}{@C} Chunk Loading Ticks{@BC}: {@H}%{_ChunkLoadTicks}%{@C} Scatter Ticks{@BC}: {@H}%{_ScatterTicks}%"
  166. command "/scattersound"
  167. wait 2 ticks
  168. broadcast "{@P}{@C} This operation will take approximately {@H}%{_ApproxTime}% seconds!"
  169. command "/scattersound"
  170. loop ({_Size}) times:
  171. loop {@Tries} times:
  172. if (loop-number-2) is {@Tries}:
  173. loop ({_Size}) times:
  174. loop {@Tries} times:
  175. if (loop-number-2) is {@Tries}:
  176. broadcast "{@P}{@C}Couldn't scatter {@BC}[{@H}%({_Size})-(loop-number-1)%{@BC}/{@H}%{_Size}%{@BC}]{@C} players!"
  177. send "{@P} {@C}Locations couldn't be found! {@BC}[{@C}Too big of a {@H}mindist!{@BC}]"
  178. send "{@P} {@C}You may want to do {@H}/tpall!"
  179. command "/scatterbroke"
  180. stop trigger
  181. set {_Location.Good} to true
  182. set {_Location.Sky} to (the location at ((random integer between ({_X}-(arg 2)) and ((arg 2)-1))+0.5), 255, ((random integer between ({_Z}-(arg 2)) and ((arg 2)-1))+0.5) of the world (arg 1))
  183. loop ((loop-number-1)-1) times:
  184. (distance between {_Location.Sky} and {_GoodLocation.Sky::%loop-number-3%}) is less than ({_Mindist})
  185. delete {_Location.Good}
  186. if {_Location.Good} is true:
  187. set {_Location.GroundLevel} to {_Location.Sky}
  188. while (block at {_Location.GroundLevel}) is air:
  189. if (y-coordinate of ({_Location.GroundLevel})) is less than 4:
  190. delete {_Location.Good}
  191. exit loop
  192. set {_Location.GroundLevel} to (location 1 below ({_Location.GroundLevel}))
  193. if {_Location.Good} is true:
  194. if (block at {_Location.GroundLevel}) is lava, water or cactus:
  195. delete {_Location.Good}
  196. else:
  197. set {_GoodLocation.Sky::%loop-number-1%} to ({_Location.Sky})
  198. set {_GoodLocation.GroundLevel::%loop-number-1%} to (location 1 above {_Location.GroundLevel})
  199. wait 1 tick
  200. exit 9 sections
  201. set {_Location.Good} to true
  202. set {_Location.Sky} to (the location at ((random integer between ({_X}-(arg-2)) and (({_X}-1))+0.5)+arg-2), 255, ((random integer between ({_Z}-(arg-2)) and (({_Z}-1))+0.5)+arg-2) of the world (arg-1))
  203. loop ((loop-number-1)-1) times:
  204. (distance between {_Location.Sky} and {_GoodLocation.Sky::%loop-number-3%}) is less than ({_Mindist})
  205. delete {_Location.Good}
  206. if {_Location.Good} is true:
  207. set {_Location.GroundLevel} to {_Location.Sky}
  208. while (block at {_Location.GroundLevel}) is air:
  209. if (y-coordinate of ({_Location.GroundLevel})) is less than 4:
  210. delete {_Location.Good}
  211. exit loop
  212. set {_Location.GroundLevel} to (location 1 below ({_Location.GroundLevel}))
  213. if {_Location.Good} is true:
  214. if (block at {_Location.GroundLevel}) is lava, water or cactus:
  215. delete {_Location.Good}
  216. else:
  217. set {_GoodLocation.Sky::%loop-number-1%} to ({_Location.Sky})
  218. set {_GoodLocation.GroundLevel::%loop-number-1%} to (location 1 above {_Location.GroundLevel})
  219. wait 1 tick
  220. exit loop
  221. if {@Vanish} is true:
  222. command "/invis on"
  223. set {Scatter.DontUnloadChunks} to true
  224. broadcast ""
  225. set {_Time} to now
  226. set {_Size2} to {_Size}
  227. broadcast "{@P} {@C}Locations found! Starting the {@H}scatter {@C}process!"
  228. while {_Size2} is more than 0:
  229. if {_Size2} is less than {@ScaTimes}+1:
  230. if {@LoadGeneratedChunks} is true:
  231. loop {_Size2} times:
  232. if command sender is not online:
  233. broadcast "{@P} {@C}Stopping {@H}scatter! {@C}Chunkloading player logged out."
  234. command "/scatterbroke"
  235. stop trigger
  236. add 1 to {_Chunks}
  237. teleport command sender to {_GoodLocation.GroundLevel::%{_Chunks}%}
  238. if {@Butcher} is true:
  239. player command "/butcher %arg-2%"
  240. loop {_ChunkLoadTicks} times:
  241. wait 1 tick
  242. loop {_Size2} times:
  243. if {@LoadGeneratedChunks} is not true:
  244. if {@Butcher} is true:
  245. player command "/butcher %arg-2%"
  246. set {_Scatter.Player} to a random element out of {_ToScatter::*}
  247. set {_Scatter.Player} to {_Scatter.Player} parsed as offlineplayer
  248. remove {_Scatter.Player} from {_ToScatter::*}
  249. add 1 to {_Scattered}
  250. if {_Scatter.Player} is not online:
  251. if {_Scatter.Player} is "%command sender%":
  252. set {_CMDSender} to {_GoodLocation.GroundLevel::%{_Scattered}%}
  253. else:
  254. set {SchedueldScatter::%{_Scatter.Player}%} to ({_GoodLocation.GroundLevel::%{_Scattered}%})
  255. else:
  256. if {_Scatter.Player} is "%command sender%":
  257. set {_CMDSender} to {_GoodLocation.GroundLevel::%{_Scattered}%}
  258. else:
  259. teleport {_Scatter.Player} to ({_GoodLocation.GroundLevel::%{_Scattered}%})
  260. send "{@P}{@H} You {@C}were scattered!" to {_Scatter.Player}
  261. loop {_ScatterTicks} times:
  262. wait 1 tick
  263. set {_Size2} to 0
  264. exit loop
  265. else:
  266. if {@LoadGeneratedChunks} is true:
  267. loop {@ScaTimes} times:
  268. if command sender is not online:
  269. broadcast "{@P} {@C}Stopping {@H}scatter! {@C}Chunkloading player logged out."
  270. command "/scatterbroke"
  271. stop trigger
  272. add 1 to {_Chunks}
  273. teleport command sender to {_GoodLocation.GroundLevel::%{_Chunks}%}
  274. if {@Butcher} is true:
  275. player command "/butcher %arg-2%"
  276. loop {_ChunkLoadTicks} times:
  277. wait 1 tick
  278. loop {@ScaTimes} times:
  279. if {@LoadGeneratedChunks} is not true:
  280. if {@Butcher} is true:
  281. player command "/butcher %arg-2%"
  282. set {_Scatter.Player} to a random element out of {_ToScatter::*}
  283. set {_Scatter.Player} to {_Scatter.Player} parsed as offlineplayer
  284. remove {_Scatter.Player} from {_ToScatter::*}
  285. remove 1 from {_Size2}
  286. add 1 to {_Scattered}
  287. if {_Scatter.Player} is not online:
  288. if {_Scatter.Player} is "%command sender%":
  289. set {_CMDSender} to {_GoodLocation.GroundLevel::%{_Scattered}%}
  290. else:
  291. set {SchedueldScatter::%{_Scatter.Player}%} to ({_GoodLocation.GroundLevel::%{_Scattered}%})
  292. else:
  293. if {_Scatter.Player} is "%command sender%":
  294. set {_CMDSender} to {_GoodLocation.GroundLevel::%{_Scattered}%}
  295. else:
  296. teleport {_Scatter.Player} to ({_GoodLocation.GroundLevel::%{_Scattered}%})
  297. send "{@P}{@H} You {@C}were scattered!" to {_Scatter.Player}
  298. loop {_ScatterTicks} times:
  299. wait 1 tick
  300. if {_Size2} is more than {@ScaTimes}:
  301. 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!"
  302. else:
  303. 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!"
  304. command "/scattersound"
  305. wait 5 seconds
  306. if {@Butcher} is true:
  307. player command "/butcher %arg-2%"
  308. wait 1 tick
  309. broadcast ""
  310. broadcast "{@P}{@C} A total of {@BC}[{@H}%{_Scattered}%{@BC}] {@C}players scattered! Took {@H}%difference between {_Time} and now%!"
  311. broadcast "{@P}{@C} Lowest Mindist{@BC}: {@H}%{_Mindist}%{@C} Radius{@BC}: {@H}%arg-2%"
  312. broadcast "{@P}{@C} Chunk Loading Ticks{@BC}: {@H}%{_ChunkLoadTicks}%{@C} Scatter Ticks{@BC}: {@H}%{_ScatterTicks}%"
  313. teleport command sender to {_CMDSender}
  314. wait 1 tick
  315. if {@Sounds} is true:
  316. loop all players:
  317. command "/playsound note.pling %loop-player%"
  318. if {@MobSpawning} is false:
  319. player command "/gamerule doMobSpawning true"
  320. loop 10 times:
  321. if {@Butcher} is true:
  322. player command "/butcher %arg-2%"
  323. wait 1 second
  324. else:
  325. loop 5 times:
  326. if {@Butcher} is true:
  327. player command "/butcher %arg-2%"
  328. wait 1 second
  329. if {@Vanish} is true:
  330. command "/invis off"
  331. delete {Scatter.DontUnloadChunks}
  332.  
  333. #--------------------------------------------------#
  334. # Team + Solo Scatter #
  335. #--------------------------------------------------#
  336.  
  337. else if arg-3 is "team" or "teams":
  338. command "/tm rebuild"
  339. command "/tm color"
  340. if command sender is console:
  341. stop trigger
  342. set {_Count} to 0
  343. loop {Teams::*}:
  344. {Team.%loop-value%::*} is set
  345. increase {_Count} by 1
  346. add {_Count} to {_TeamsToScatter::*}
  347. set {_TeamScatter.%{_Count}%::*} to ({Team.%loop-value%::*})
  348. loop all players:
  349. {Teams.InTeam::%loop-player%} is not set
  350. add loop-player to {_Solos::*}
  351. loop all players:
  352. {@SpecVariable} is true
  353. remove loop-player from {_Solos::*}
  354. set {_TeamSize} to (size of {Teams::*})
  355. set {_SoloSize} to (size of {_Solos::*})
  356. set {_TeamSize2} to (size of {Teams::*})
  357. set {_SoloSize2} to (size of {_Solos::*})
  358. set {_Size} to ((size of {Teams::*})+(size of {_Solos::*}))
  359. if arg-4 is set:
  360. if arg-4 is equal to 0:
  361. set {_Mindist} to (arg-2/{_Size})*3.5
  362. if arg-2 is less than {_Mindist}:
  363. set {_Mindist} to argument 2-100
  364. else:
  365. set {_Mindist} to arg-4
  366. else:
  367. set {_Mindist} to (arg-2/{_Size})*3.5
  368. if arg-2 is less than {_Mindist}:
  369. set {_Mindist} to argument 2-100
  370. if arg-5 is set:
  371. set {_X} to arg-5
  372. else:
  373. set {_X} to 0
  374. if arg-6 is set:
  375. set {_Z} to arg-6
  376. else:
  377. set {_Z} to 0
  378. if arg-7 is set:
  379. set {_ChunkLoadTicks} to arg-7
  380. else:
  381. set {_ChunkLoadTicks} to round({@UnitRateChunks}/{@UnitRatePlayers}*{_Size})
  382. if arg-8 is set:
  383. set {_ScatterTicks} to arg-8
  384. else:
  385. set {_ScatterTicks} to round({@UnitRateScatter}/{@UnitRatePlayers}*{_Size})
  386. if {_ChunkLoadTicks} is 0:
  387. set {_ChunkLoadTicks} to 1
  388. if {_ScatterTicks} is 0:
  389. set {_ScatterTicks} to 1
  390. set {_CMDLocB} to (location at (0, 256, 0) of the world arg-1)
  391. while (block at {_CMDLocB}) is air:
  392. set {_CMDLocB} to location 1 below {_CMDLocB}
  393. if y-coordinate of {_CMDLocB} is less than 3:
  394. set {_CMDLocB} to (location at (0, 256, 0) of the world arg-1)
  395. wait 1 tick
  396. teleport the command sender to (location 1 above {_CMDLocB})
  397. if {@MobSpawning} is false:
  398. player command "/gamerule doMobSpawning false"
  399. set {_ApproxTime} to ({_Size}*({_ChunkLoadTicks}+{_ScatterTicks})/20)+(({_Size}/{@ScaTimes})*5)+3
  400. broadcast "{@P}{@C} Attempting to scatter {@BC}[{@H}%{_TeamSize}%{@BC}]{@C} teams & {@BC}[{@H}%{_SoloSize}%{@BC}] {@C}solos around {@H}%{_X}%,%{_Z}%!"
  401. command "/scattersound"
  402. wait 2 ticks
  403. broadcast "{@P}{@C} Lowest Mindist{@BC}: {@H}%{_Mindist}%{@C} Radius{@BC}: {@H}%arg-2%"
  404. command "/scattersound"
  405. wait 2 ticks
  406. broadcast "{@P}{@C} Chunk Loading Ticks{@BC}: {@H}%{_ChunkLoadTicks}%{@C} Scatter Ticks{@BC}: {@H}%{_ScatterTicks}%"
  407. command "/scattersound"
  408. wait 2 ticks
  409. broadcast "{@P}{@C} This operation will take approximately {@H}%{_ApproxTime}% seconds!"
  410. command "/scattersound"
  411. loop ({_Size}) times:
  412. loop {@Tries} times:
  413. if (loop-number-2) is {@Tries}:
  414. loop ({_Size}) times:
  415. loop {@Tries} times:
  416. if (loop-number-2) is {@Tries}:
  417. broadcast "{@P}{@C}Couldn't scatter {@BC}[{@H}%({_Size})-(loop-number-1)%{@BC}/{@H}%{_Size}%{@BC}]{@C} players!"
  418. send "{@P} {@C}Locations couldn't be found! {@BC}[{@C}Too big of a {@H}mindist!{@BC}]"
  419. send "{@P} {@C}You may want to do {@H}/tpall!"
  420. command "/scatterbroke"
  421. stop trigger
  422. set {_Location.Good} to true
  423. set {_Location.Sky} to (the location at ((random integer between ({_X}-(arg 2)) and ((arg 2)-1))+0.5), 255, ((random integer between ({_Z}-(arg 2)) and ((arg 2)-1))+0.5) of the world (arg 1))
  424. loop ((loop-number-1)-1) times:
  425. (distance between {_Location.Sky} and {_GoodLocation.Sky::%loop-number-3%}) is less than ({_Mindist})
  426. delete {_Location.Good}
  427. if {_Location.Good} is true:
  428. set {_Location.GroundLevel} to {_Location.Sky}
  429. while (block at {_Location.GroundLevel}) is air:
  430. if (y-coordinate of ({_Location.GroundLevel})) is less than 4:
  431. delete {_Location.Good}
  432. exit loop
  433. set {_Location.GroundLevel} to (location 1 below ({_Location.GroundLevel}))
  434. if {_Location.Good} is true:
  435. if (block at {_Location.GroundLevel}) is lava, water or cactus:
  436. delete {_Location.Good}
  437. else:
  438. set {_GoodLocation.Sky::%loop-number-1%} to ({_Location.Sky})
  439. set {_GoodLocation.GroundLevel::%loop-number-1%} to (location 1 above {_Location.GroundLevel})
  440. wait 1 tick
  441. exit 9 sections
  442. set {_Location.Good} to true
  443. set {_Location.Sky} to (the location at ((random integer between ({_X}-(arg-2)) and (({_X}-1))+0.5)+arg-2), 255, ((random integer between ({_Z}-(arg-2)) and (({_Z}-1))+0.5)+arg-2) of the world (arg-1))
  444. loop ((loop-number-1)-1) times:
  445. (distance between {_Location.Sky} and {_GoodLocation.Sky::%loop-number-3%}) is less than ({_Mindist})
  446. delete {_Location.Good}
  447. if {_Location.Good} is true:
  448. set {_Location.GroundLevel} to {_Location.Sky}
  449. while (block at {_Location.GroundLevel}) is air:
  450. if (y-coordinate of ({_Location.GroundLevel})) is less than 4:
  451. delete {_Location.Good}
  452. exit loop
  453. set {_Location.GroundLevel} to (location 1 below ({_Location.GroundLevel}))
  454. if {_Location.Good} is true:
  455. if (block at {_Location.GroundLevel}) is lava, water or cactus:
  456. delete {_Location.Good}
  457. else:
  458. set {_GoodLocation.Sky::%loop-number-1%} to ({_Location.Sky})
  459. set {_GoodLocation.GroundLevel::%loop-number-1%} to (location 1 above {_Location.GroundLevel})
  460. wait 1 tick
  461. exit loop
  462. if {@Vanish} is true:
  463. command "/invis on"
  464. set {Scatter.DontUnloadChunks} to true
  465. broadcast ""
  466. set {_Time} to now
  467. broadcast "{@P} {@C}Locations found! Starting the {@H}scatter {@C}process!"
  468. while {_TeamSize} is more than 0:
  469. if {Teams::*} is not set:
  470. exit loop
  471. if {_TeamSize} is less than {@ScaTimes}+1:
  472. if {@LoadGeneratedChunks} is true:
  473. loop {_TeamSize} times:
  474. if command sender is not online:
  475. broadcast "{@P} {@C}Stopping {@H}scatter! {@C}Chunkloading player logged out."
  476. command "/scatterbroke"
  477. stop trigger
  478. add 1 to {_Chunks}
  479. teleport command sender to {_GoodLocation.GroundLevel::%{_Chunks}%}
  480. if {@Butcher} is true:
  481. player command "/butcher %arg-2%"
  482. loop {_ChunkLoadTicks} times:
  483. wait 1 tick
  484. loop {_TeamSize} times:
  485. if {@LoadGeneratedChunks} is not true:
  486. if {@Butcher} is true:
  487. player command "/butcher %arg-2%"
  488. set {_Scatter.Team} to a random element out of {_TeamsToScatter::*}
  489. remove {_Scatter.Team} from {_TeamsToScatter::*}
  490. add 1 to {_Scattered}
  491. add 1 to {_TotalScattered}
  492. loop {_TeamScatter.%{_Scatter.Team}%::*}:
  493. set {_Scatter.Player} to ("%loop-value%" parsed as offlineplayer)
  494. if {_Scatter.Player} is not online:
  495. if {_Scatter.Player} is "%command sender%":
  496. set {_CMDSender} to {_GoodLocation.GroundLevel::%{_TotalScattered}%}
  497. else:
  498. set {SchedueldScatter::%{_Scatter.Player}%} to ({_GoodLocation.GroundLevel::%{_TotalScattered}%})
  499. else:
  500. if {_Scatter.Player} is "%command sender%":
  501. set {_CMDSender} to {_GoodLocation.GroundLevel::%{_TotalScattered}%}
  502. else:
  503. teleport {_Scatter.Player} to ({_GoodLocation.GroundLevel::%{_TotalScattered}%})
  504. send "{@P}{@H} You {@C}were scattered!" to {_Scatter.Player}
  505. loop {_ScatterTicks} times:
  506. wait 1 tick
  507. set {_TeamSize} to 0
  508. exit loop
  509. else:
  510. if {@LoadGeneratedChunks} is true:
  511. loop {@ScaTimes} times:
  512. if command sender is not online:
  513. broadcast "{@P} {@C}Stopping {@H}scatter! {@C}Chunkloading player logged out."
  514. command "/scatterbroke"
  515. stop trigger
  516. add 1 to {_Chunks}
  517. teleport command sender to {_GoodLocation.GroundLevel::%{_Chunks}%}
  518. if {@Butcher} is true:
  519. player command "/butcher %arg-2%"
  520. loop {_ChunkLoadTicks} times:
  521. wait 1 tick
  522. loop {@ScaTimes} times:
  523. if {@LoadGeneratedChunks} is not true:
  524. if {@Butcher} is true:
  525. player command "/butcher %arg-2%"
  526. set {_Scatter.Team} to a random element out of {_TeamsToScatter::*}
  527. remove {_Scatter.Team} from {_TeamsToScatter::*}
  528. remove 1 from {_TeamSize}
  529. add 1 to {_Scattered}
  530. add 1 to {_TotalScattered}
  531. loop {_TeamScatter.%{_Scatter.Team}%::*}:
  532. set {_Scatter.Player} to ("%loop-value%" parsed as offlineplayer)
  533. if {_Scatter.Player} is not online:
  534. if {_Scatter.Player} is "%command sender%":
  535. set {_CMDSender} to {_GoodLocation.GroundLevel::%{_TotalScattered}%}
  536. else:
  537. set {SchedueldScatter::%{_Scatter.Player}%} to ({_GoodLocation.GroundLevel::%{_TotalScattered}%})
  538. else:
  539. if {_Scatter.Player} is "%command sender%":
  540. set {_CMDSender} to {_GoodLocation.GroundLevel::%{_TotalScattered}%}
  541. else:
  542. teleport {_Scatter.Player} to ({_GoodLocation.GroundLevel::%{_TotalScattered}%})
  543. send "{@P}{@H} You {@C}were scattered!" to {_Scatter.Player}
  544. loop {_ScatterTicks} times:
  545. wait 1 tick
  546. if {_TeamSize} is more than 9:
  547. broadcast "{@P}{@C} Scattered {@BC}[{@H}%{_Scattered}%{@C}/{@H}%{_TeamSize2}%{@BC}] {@C}teams! {@C}Waiting {@BC}[{@H}5{@BC}] {@H}seconds {@C}to scatter {@BC}[{@H}10{@BC}] {@C}more teams!"
  548. else:
  549. broadcast "{@P}{@C} Scattered {@BC}[{@H}%{_Scattered}%{@C}/{@H}%{_TeamSize2}%{@BC}] {@C}teams! {@C}Waiting {@BC}[{@H}5{@BC}] {@H}seconds {@C}to scatter {@BC}[{@H}%{_TeamSize}%{@BC}] {@C}more teams!"
  550. command "/scattersound"
  551. wait 5 seconds
  552. if {@Butcher} is true:
  553. player command "/butcher %arg-2%"
  554. if {Teams::*} is set:
  555. broadcast "{@P}{@C} Scattered {@BC}[{@H}%{_Scattered}%{@C}/{@H}%{_TeamSize2}%{@BC}] {@C}teams! {@C}Waiting {@BC}[{@H}3{@BC}] {@H}seconds {@C}to scatter solo players!"
  556. command "/scattersound"
  557. wait 3 seconds
  558. if {@Butcher} is true:
  559. player command "/butcher %arg-2%"
  560. set {_Scattered.Teams} to {_Scattered}
  561. set {_Scattered} to 0
  562. while {_SoloSize} is more than 0:
  563. if {_Solos::*} is not set:
  564. exit loop
  565. if {_SoloSize} is less than {@ScaTimes}+1:
  566. if {@LoadGeneratedChunks} is true:
  567. loop {_SoloSize} times:
  568. if command sender is not online:
  569. broadcast "{@P} {@C}Stopping {@H}scatter! {@C}Chunkloading player logged out."
  570. command "/scatterbroke"
  571. stop trigger
  572. add 1 to {_Chunks}
  573. teleport command sender to {_GoodLocation.GroundLevel::%{_Chunks}%}
  574. if {@Butcher} is true:
  575. player command "/butcher %arg-2%"
  576. loop {_ChunkLoadTicks} times:
  577. wait 1 tick
  578. loop {_SoloSize} times:
  579. if {@LoadGeneratedChunks} is not true:
  580. if {@Butcher} is true:
  581. player command "/butcher %arg-2%"
  582. set {_Scatter.Player} to a random element out of {_Solos::*}
  583. set {_Scatter.Player} to {_Scatter.Player} parsed as offlineplayer
  584. remove {_Scatter.Player} from {_Solos::*}
  585. add 1 to {_Scattered}
  586. add 1 to {_TotalScattered}
  587. if {_Scatter.Player} is not online:
  588. if {_Scatter.Player} is "%command sender%":
  589. set {_CMDSender} to {_GoodLocation.GroundLevel::%{_TotalScattered}%}
  590. else:
  591. set {SchedueldScatter::%{_Scatter.Player}%} to ({_GoodLocation.GroundLevel::%{_TotalScattered}%})
  592. else:
  593. if {_Scatter.Player} is "%command sender%":
  594. set {_CMDSender} to {_GoodLocation.GroundLevel::%{_TotalScattered}%}
  595. else:
  596. teleport {_Scatter.Player} to ({_GoodLocation.GroundLevel::%{_TotalScattered}%})
  597. send "{@P}{@H} You {@C}were scattered!" to {_Scatter.Player}
  598. loop {_ScatterTicks} times:
  599. wait 1 tick
  600. set {_SoloSize} to 0
  601. exit loop
  602. else:
  603. if {@LoadGeneratedChunks} is true:
  604. loop {@ScaTimes} times:
  605. if command sender is not online:
  606. broadcast "{@P} {@C}Stopping {@H}scatter! {@C}Chunkloading player logged out."
  607. command "/scatterbroke"
  608. stop trigger
  609. add 1 to {_Chunks}
  610. teleport command sender to {_GoodLocation.GroundLevel::%{_Chunks}%}
  611. if {@Butcher} is true:
  612. player command "/butcher %arg-2%"
  613. loop {_ChunkLoadTicks} times:
  614. wait 1 tick
  615. loop {@ScaTimes} times:
  616. if {@LoadGeneratedChunks} is not true:
  617. if {@Butcher} is true:
  618. player command "/butcher %arg-2%"
  619. set {_Scatter.Player} to a random element out of {_Solos::*}
  620. set {_Scatter.Player} to {_Scatter.Player} parsed as offlineplayer
  621. remove {_Scatter.Player} from {_Solos::*}
  622. remove 1 from {_SoloSize}
  623. add 1 to {_Scattered}
  624. add 1 to {_TotalScattered}
  625. if {_Scatter.Player} is not online:
  626. if {_Scatter.Player} is "%command sender%":
  627. set {_CMDSender} to {_GoodLocation.GroundLevel::%{_TotalScattered}%}
  628. else:
  629. set {SchedueldScatter::%{_Scatter.Player}%} to ({_GoodLocation.GroundLevel::%{_TotalScattered}%})
  630. else:
  631. if {_Scatter.Player} is "%command sender%":
  632. set {_CMDSender} to {_GoodLocation.GroundLevel::%{_TotalScattered}%}
  633. else:
  634. teleport {_Scatter.Player} to ({_GoodLocation.GroundLevel::%{_TotalScattered}%})
  635. send "{@P}{@H} You {@C}were scattered!" to {_Scatter.Player}
  636. loop {_ScatterTicks} times:
  637. wait 1 tick
  638. if {_SoloSize} is more than {@ScaTimes}:
  639. 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!"
  640. else:
  641. 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!"
  642. command "/scattersound"
  643. wait 5 seconds
  644. if {@Butcher} is true:
  645. player command "/butcher %arg-2%"
  646. wait 1 tick
  647. set {_Scattered.Solos} to {_Scattered}
  648. if {Teams::*} is not set:
  649. set {_Scattered.Teams} to 0
  650. if size of {_Solos::*} is less than 1:
  651. set {_Scattered.Solos} to 0
  652. broadcast ""
  653. 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%!"
  654. broadcast "{@P}{@C} Lowest Mindist{@BC}: {@H}%{_Mindist}%{@C} Radius{@BC}: {@H}%arg-2%"
  655. broadcast "{@P}{@C} Chunk Loading Ticks{@BC}: {@H}%{_ChunkLoadTicks}%{@C} Scatter Ticks{@BC}: {@H}%{_ScatterTicks}%"
  656. teleport command sender to {_CMDSender}
  657. wait 1 tick
  658. if {@Sounds} is true:
  659. loop all players:
  660. command "/playsound note.pling %loop-player%"
  661. if {@MobSpawning} is false:
  662. player command "/gamerule doMobSpawning true"
  663. loop 10 times:
  664. if {@Butcher} is true:
  665. player command "/butcher %arg-2%"
  666. wait 1 second
  667. else:
  668. loop 5 times:
  669. if {@Butcher} is true:
  670. player command "/butcher %arg-2%"
  671. wait 1 second
  672. if {@Vanish} is true:
  673. command "/invis off"
  674. delete {Scatter.DontUnloadChunks}
  675.  
  676. #--------------------------------------------------#
  677. # Single Player Scatter #
  678. #--------------------------------------------------#
  679.  
  680. else if ("%arg-3%" parsed as offlineplayer) is online:
  681. loop {@Tries} times:
  682. if (loop-number-2) is {@Tries}:
  683. broadcast "{@P}{@C} Could not scatter {@H}%arg-3%!"
  684. send "{@P}{@C} Try lowering the {@H}mindist!"
  685. command "/scatterbroke"
  686. stop trigger
  687. set {_Location.Good} to true
  688. set {_Location.Sky} to (the location at ((random integer between ({_X}-(arg-2)) and (({_X}-1))+0.5)+arg-2), 255, ((random integer between ({_Z}-(arg-2)) and (({_Z}-1))+0.5)+arg-2) of the world (arg-1))
  689. if {_Location.Good} is true:
  690. set {_Location.GroundLevel} to {_Location.Sky}
  691. while (block at {_Location.GroundLevel}) is air:
  692. if (y-coordinate of ({_Location.GroundLevel})) is less than 4:
  693. delete {_Location.Good}
  694. stop loop
  695. set {_Location.GroundLevel} to (location 1 below ({_Location.GroundLevel}))
  696. if {_Location.Good} is true:
  697. if (block at {_Location.GroundLevel}) is lava, water or cactus:
  698. delete {_Location.Good}
  699. else:
  700. set {_GoodLocation.Sky} to ({_Location.Sky})
  701. set {_GoodLocation.GroundLevel} to (location 1 above {_Location.GroundLevel})
  702. stop loop
  703. set {Scattering::%arg-3%} to true
  704. teleport ("%arg-3%" parsed as offlineplayer) to ({_GoodLocation.GroundLevel})
  705. send "{@P} {@BC}- {@H}%arg-3%{@C} Scattered." to all ops
  706. wait 1 second
  707. delete {Scatter.Scattering::%arg-3%}
  708.  
  709. #--------------------------------------------------#
  710. # Invisible Command #
  711. # Thank you Cam for making this! #
  712. #--------------------------------------------------#
  713.  
  714. command /invis [<text=toggle>]:
  715. permission: {@Permission}
  716. trigger:
  717. if arg-1 is "on" or "enable":
  718. set {invis} to true
  719. loop all players:
  720. command "/van %loop-player%"
  721. add loop-player to {Invis::*}
  722. else if arg-1 is "off" or "disable":
  723. delete {invis}
  724. loop {Invis::*}:
  725. command "/rea %loop-value%"
  726. remove loop-value from {Invis::*}
  727. else if arg-1 is "toggle":
  728. if {invis} is set:
  729. delete {invis}
  730. loop {Invis::*}:
  731. command "/rea %loop-value%"
  732. remove loop-value from {Invis::*}
  733. else:
  734. set {invis} to true
  735. loop all players:
  736. command "/van %loop-player%"
  737. add loop-player to {Invis::*}
  738.  
  739. #--------------------------------------------------#
  740. # Scatter Sound Commands #
  741. #--------------------------------------------------#
  742.  
  743. command /scattersound:
  744. permission: {@Permission}
  745. trigger:
  746. {@Sounds} is true
  747. loop all players:
  748. command "/playsound {@ScatterSound} %loop-player% ~ ~ ~ 1 0.5 1"
  749.  
  750. command /scatterbroke:
  751. permission: {@Permission}
  752. trigger:
  753. {@Sounds} is true
  754. loop all players:
  755. command "/playsound random.break %loop-player%"
  756.  
  757. #--------------------------------------------------#
  758. # Miscellaneous Things #
  759. #--------------------------------------------------#
  760.  
  761. on join:
  762. {invis} is true
  763. command "/van %event-player%"
  764. add event-player to {Invis::*}
  765.  
  766. on skript load:
  767. delete {Scatter.DontUnloadChunks}
  768. delete {Scatter.Scattering::*}
  769. broadcast "{@P}{@C} Thanks for installing {@H}Nate's scatter version {@BC}[{@H}4.3{@BC}]!"
  770. broadcast "{@P}{@C} If you have any questions, tweet at {@H}@NatePlaysUHC!"
  771. broadcast "{@P}{@C} Want to see the {@H}scatter {@C}in action, follow {@H}@OblivionUHC {@C}on {@H}twitter!"
  772.  
  773. on login:
  774. delete {Scatter.Scattering::%player%}
  775. {SchedueldScatter::%player%} is set
  776. teleport (player) to ({SchedueldScatter::%player%})
  777. delete {SchedueldScatter::%player%}
  778. send "{@P} {@BC}- {@H}%player% {@BC}- {@C}Late Scattered!" to all ops
  779.  
  780. on chunk unload:
  781. {Scatter.DontUnloadChunks} is true
  782. cancel the event
  783.  
  784. on damage of a player:
  785. {Scatter.Scattering::%victim%} is true
  786. cancel the event
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement