Advertisement
fleft17

Untitled

Nov 27th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.99 KB | None | 0 0
  1. options:
  2.  
  3.  
  4. #--------------------------------------------------
  5. # Options
  6. #--------------------------------------------------
  7.  
  8. P: §7[§bScatter§7]
  9. # Prefix for scatter messages
  10. H: §c
  11. # Chat color when there's **x** seconds, **player**, misc
  12. C: §f
  13. # Main chat color
  14. H2: §a
  15. # Second highlight
  16. Tries: 1001
  17. # Limit to how many times the Skript will attempt to load a given location
  18.  
  19. command /scatterall [<world>] [<integer>] [<integer>]:
  20. permission: skript.fleftscatter
  21. trigger:
  22. if arg-1 is not set:
  23. message "{@P}{@C} /scatterall <world> <radius> <mindist>"
  24. else if arg-2 is not set:
  25. message "{@P}{@C} /scatterall <world> <radius> <mindist>"
  26. else if arg-3 is not set:
  27. message "{@P}{@C} /scatterall <world> <radius> <mindist>"
  28. else:
  29. set {_Players::*} to all players
  30. set {_Amount} to (size of {_Players::*})
  31. loop {_Players::*}:
  32. add 1 to {_count}
  33. set {_Players::%{_count}%} to loop-value
  34. set {Scatter.DisableChunkUnload} to true
  35. set {_world} to arg-1
  36. set {_radius} to arg-2
  37. set {_mindist} to arg-3
  38. set {_pause} to ceil({_Amount}/10)
  39. broadcast "%{_pause}%"
  40. broadcast "{@P}{@C} Attempt: Radius {@H}%{_radius}%{@C} and mindist {@H}%{_mindist}%!"
  41. command "/aps fireworks.twinkle"
  42. wait 20 ticks
  43. loop {_Amount} times:
  44.  
  45. loop {@Tries} times:
  46. if loop-number-2 is equal to {@Tries}:
  47. broadcast "{@P}{@C} Scatter failed!"
  48. broadcast "{@P}{@C} Lowest mindist?"
  49. command "/aps random.break"
  50. delete {Scatter.DisableChunkLoading}
  51. stop trigger
  52. set {_GoodLocation} to true
  53. set {_SkyLocation} to (the location at ((random integer between (0-{_radius}) and ({_radius}-1))+0.5), 255, ((random integer between (0-{_radius}) and ({_radius}-1))+0.5) of the world {_world})
  54. loop ((loop-number-1)-1) times:
  55. {_GoodLocation} is true
  56. distance between {_SkyLocation} and {_FinalLocations.Sky::%loop-number-3%} is less than {_mindist}
  57. delete {_GoodLocation}
  58. if {_GoodLocation} is true:
  59. set {_GroundLocation} to {_SkyLocation}
  60. while (block at {_GroundLocation}) is air:
  61. if y-coordinate of {_GroundLocation} is less than 5:
  62. delete {_GoodLocation}
  63. stop loop
  64. set {_GroundLocation} to location 1 below {_GroundLocation}
  65. if {_GoodLocation} is true:
  66. if (block at {_GroundLocation}) is cactus, water, or lava:
  67. delete {_GoodLocation}
  68. if {_GoodLocation} is true:
  69. set {_FinalLocations.Sky::%loop-number-1%} to {_SkyLocation}
  70. set {_GroundLocation} to (location 1 above {_GroundLocation})
  71. set {_FinalLocations::%loop-number-1%} to {_GroundLocation}
  72. wait 1 tick
  73. stop loop
  74. broadcast "{@P}{@C} Chunkload should take %{_Amount}/2% seconds."
  75. command "/aps note.bass"
  76. loop {_Amount} times:
  77. command sender is not online:
  78. broadcast "{@P}{@C} Scatter failed, command sender logged out."
  79. command "/aps random.break"
  80. stop trigger
  81. else:
  82. teleport (command sender) to {_FinalLocations::%loop-number%}
  83. message "{@P}{@H} Chunkload:{@C} [{@H2}%loop-number%{@C}/%{_Amount}%]"
  84. wait 10 ticks
  85. broadcast "{@P}{@C} Chunkload complete…"
  86. wait 20 ticks
  87. broadcast "{@P}{@C} Scattering all players."
  88. wait 20 ticks
  89.  
  90. loop {_Amount} times:
  91. if {_Players::%loop-number%} is not online:
  92. broadcast "{@P}{@H} %{_Players::%loop-number%}% {@C}- Scheduled"
  93. set {ScatterScheduler::%{_Players::%loop-number%}%} to {_FinalLocations::%loop-number%}
  94. else:
  95. add 1 to {_pausetimer}
  96. if {_pausetimer} is equal to {_pause}:
  97. set {_pausetimer} to 0
  98. wait 10 ticks
  99. broadcast "{@P}{@H} %{_Players::%loop-number%}% {@C}[%loop-number%/%{_Amount}%]"
  100. teleport {_Players::%loop-number%} to {_FinalLocations::%loop-number%}
  101. command "/aps note.harp 2"
  102. wait 1 tick
  103. command "/aps mob.enderdragon.growl"
  104. broadcast "{@P}{@C} &aAll players scattered."
  105. delete {Scatter.DisableChunkUnload}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement