fleft17

Untitled

Oct 25th, 2014
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.39 KB | None | 0 0
  1. # Scatter Skript by Fleft. This is an advanced Skript. Use at your own risk. I am not responsible for any damage caused to servers because of this Skript.
  2.  
  3. # To disable/enable and of these features below, change them to simply "true" or "false".
  4.  
  5. # This was meant to be used in UHC games on www.reddit.com/r/ultrahardcore.
  6.  
  7. # Version: v1.3
  8.  
  9.  
  10. options:
  11.  
  12.  
  13. #--------------------------------------------------
  14. # Options
  15. #--------------------------------------------------
  16.  
  17. P: §f[§7Scatter]
  18. # Prefix for scatter messages
  19.  
  20. H: §9
  21. # Chat color when there's **x** seconds, **player**, misc
  22.  
  23. C: §f
  24. # Main chat color
  25.  
  26. Tries: 1001
  27. # Limit to how many times the Skript will attempt to load a given location
  28.  
  29. #--------------------------------------------------
  30. # Command
  31. #--------------------------------------------------
  32.  
  33. command /scatterstar [<world>] [<integer>] [<text>]:
  34. permission: skript.fleftscatter
  35. trigger:
  36.  
  37. if arg-3 is "all" or "*":
  38. set {_ListOfAllPlayers::*} to all players
  39. set {_AmountOfPlayers} to (size of {_ListOfAllPlayers::*})
  40. loop {_ListOfAllPlayers::*}:
  41. add 1 to {_count}
  42. set {_ListOfAllPlayers::%{_count}%} to loop-value
  43. if (size of ({_ListOfAllPlayers::*})) is equal to 0:
  44. message "{@P}{@C} No one can be scattered!"
  45. stop trigger
  46. set {Scatter.DisableChunkUnload} to true
  47. set {_world} to arg-1
  48. set {_radius} to arg-2
  49. set {_mindist} to (({_radius}/{_AmountOfPlayers})*3)
  50. broadcast "{@P}{@C} Attempting to scatter {@H}%{_AmountOfPlayers}%{@C} players!"
  51. loop {_AmountOfPlayers} times:
  52. loop {@Tries} times:
  53. if loop-number-2 is equal to {@Tries}:
  54. broadcast "{@P}{@C} Could not scatter %loop-number-1%/%{_AmountOfPlayers}%"
  55. broadcast "{@P}{@C} Some players may have been scattered!"
  56. broadcast "{@P}{@C} You may want to /tpall!"
  57. command "/aps random.break"
  58. delete {Scatter.DisableChunkLoading}
  59. stop trigger
  60. set {_GoodLocation} to true
  61. 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})
  62. loop ((loop-number-1)-1) times:
  63. if {_GoodLocation} is true:
  64. distance between {_SkyLocation} and {_FinalLocations.Sky::%loop-number-3%} is less than {_mindist}:
  65. delete {_GoodLocation}
  66. if {_GoodLocation} is true:
  67. set {_GroundLocation} to {_SkyLocation}
  68. while (block at {_GroundLocation}) is air:
  69. if y-coordinate of {_GroundLocation} is less than 5:
  70. delete {_GoodLocation}
  71. stop loop
  72. set {_GroundLocation} to location 1 below {_GroundLocation}
  73. if {_GoodLocation} is true:
  74. if (block at {_GroundLocation}) is cactus, water, or lava:
  75. delete {_GoodLocation}
  76. if {_GoodLocation} is true:
  77. set {_GroundLocation} to (location 1 above {_GroundLocation})
  78. add {_GroundLocation} to {_FinalLocations.Ground::*}
  79. add {_GroundLocation} to {_FinalLocations::*}
  80. wait 1 tick
  81. stop loop
  82. loop {_AmountOfPlayers} times:
  83. add 1 to {_Scattered}
  84. if {_Scattered} is equal to ({_AmountOfPlayers}/4):
  85. broadcast "{@P}{@C} Progress: 25%%"
  86. command sender is not online:
  87. broadcast "{@P}{@C} Scatter failed, command sender logged out."
  88. command "/aps random.break"
  89. stop trigger
  90. else:
  91. set {_FinalLocation} to {_FinalLocations::%loop-number%}
  92. remove {_FinalLocation} from {_FinalLocations::*}
  93. teleport (command sender) to {_FinalLocation}
  94. if {_ListOfAllPlayers::%loop-number%} is equal to (command sender):
  95. set {_CommandSenderLocation} to {_FinalLocation}
  96. wait 5 ticks
  97. teleport {_ListOfAllPlayers::%loop-number%} to (command sender)
  98. if {_CommandSenderLocation} is set:
  99. teleport (command sender) to {_CommandSenderLocation}
  100. broadcast "{@P}{@C} All players scattered"
  101. delete {Scatter.DisableChunkUnload}
  102. loop 10 times:
  103. command "/aps note.harp"
  104. command "/aps fireworks.launch"
  105. command "/aps fireworks.twinkle"
  106. wait 2 ticks
  107.  
  108.  
  109. #--------------------------------------------------
  110. # End of Scatter - Event section (and sound command)
  111. #--------------------------------------------------
  112.  
  113. on chunk unload:
  114. {Scatter.DisableChunkUnload} is true:
  115. cancel the event
  116. on skript start:
  117. delete {Scatter.DisableChunkUnloading}
Add Comment
Please, Sign In to add comment