SHARE
TWEET

Untitled

a guest Jun 20th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. options:
  2.     C: &7
  3.     H: &a
  4.    
  5.     Error: &c[Error]&6
  6.    
  7.     BroadcastScatters: true #Broadcast each time someone gets scattered?
  8.     LoadChunks: true #Teleport the command sender to each chunk before scattering
  9.     MaxTries: 1001 #How many times do you want to try to scatter before stopping?
  10.     ChunkLoadTicks: 20 #How long to wait in between loading each chunk (ticks)
  11.     ScatterTicks: 2  #How long inbetween teleporting each player to their scatter location
  12.    
  13.     DontLoadUnder: -1 #Set to a number if you dont want to load chunks UNDER this amount of players -1 or 0 for none
  14.    
  15.     Sounds: true
  16.     ScatterSound: note.pling
  17.     SoundVolume: 0.3
  18.     SoundPitch: 0.5
  19.    
  20. function barSquare(l: object):
  21.     set {_l} to the location 2 below {_l}
  22.     set block at {_l} to a barrier
  23.     set (block at (the location 1 right {_l})) to a barrier
  24.     set (block at (the location 1 left {_l})) to a barrier
  25.     set (block at (the location 1 in front {_l})) to a barrier
  26.     set (block at (the location 1 behind {_l})) to a barrier
  27.     set (block at (the location 1 right and 1 above {_l})) to a barrier
  28.     set (block at (the location 1 left and 1 above {_l})) to a barrier
  29.     set (block at (the location 1 in front and 1 above {_l})) to a barrier
  30.     set (block at (the location 1 behind and 1 above {_l})) to a barrier
  31.     loop blocks in radius 2 around {_l}:
  32.         loop-block is a barrier
  33.         add loop-block to {barriersremove::*}
  34.    
  35. command /sca [<int>] [<text>] [<text>]:
  36.     aliases: /scatterall, /scatter
  37.     permission: scatter.scatter
  38.     trigger:
  39.         if arg-1 is not set:
  40.             send "{@Error} /sca <radius> <teams/*/player name/sb/sb2> [-load]"
  41.             stop trigger
  42.         else if arg-2 is not set:
  43.             send "{@Error} /sca <radius> <teams/*/player name/sb/sb2> [-load]"
  44.             stop trigger
  45. #-------------------------     
  46. #       Solos
  47. #-------------------------
  48.         if arg-2 is "*" or "**" or "all" or "s" or "solo" or "solos":
  49.             if size of {spec::*} is 0:
  50.                 if arg-3 is "-load":
  51.                     set {_fail} to false
  52.                 {_fail} is not set
  53.                 send "&7Scatter failed. No spectators to load chunks found. Use -load in the scatter to override this." to all ops
  54.                 stop trigger
  55.             set {_ToScatter::*} to (all players)
  56.             loop all players:
  57.                 {spec::%loop-player%} is true
  58.                 remove loop-player from {_ToScatter::*}
  59.             set {_Size} to (size of {_ToScatter::*})
  60.             set {_Mindist} to (arg-1/{_Size})*3.5
  61.             hide all players from all players
  62.             broadcast "{@C}Scattering {@H}%{_Size}%{@C} players with radius {@H}%arg-1%{@C} and mindist {@H}%{_Mindist}%"
  63.             loop ({_Size}) times:
  64.                 loop {@MaxTries} times:
  65.                     if (loop-number-2) is {@MaxTries}:
  66.                         broadcast "{@C}Couldn't find locations for {@H}%({_Size})-(loop-number-1)%&0/{@H}%{_Size}%{@C} players!"
  67.                         stop trigger
  68.                     set {_Location.Good} to true
  69.                     set {_Location.Good} to true
  70.                     set {_XR} to random integer between {midx} + arg-1 and {midx} - arg-1
  71.                     set {_YR} to 250
  72.                     set {_ZR} to random integer between {midz} + arg-1 and {midz} - arg-1
  73.                     evaluate "set {_Location.Sky} to location at {_XR}, {_YR}, {_ZR} of the world ""uhc"""
  74.                     loop ((loop-number-1)-1) times:
  75.                         (distance between {_Location.Sky} and {_GoodLocation.Sky::%loop-number-3%}) is less than ({_Mindist})
  76.                         delete {_Location.Good}
  77.                     if {_Location.Good} is true:
  78.                         set {_GoodLocation.Sky::%loop-number-1%} to ({_Location.Sky})
  79.                         stop loop
  80.             set {Scatter.DontUnloadChunks} to true
  81.             if {@LoadChunks} is true:
  82.                 ({_Size}) is more than {@DontLoadUnder}
  83.                 set {_ExpectedTime} to ({_Size})*({@ChunkLoadTicks}/20)
  84.                 broadcast "{@C}Locations found, loading chunks!"
  85.                 broadcast "{@C}Loading chunks should take {@H}~%{_ExpectedTime}/size of {spec::*}%{@C} seconds."
  86.                 set {_LeftToLoad} to {_Size}
  87.                 while {_LeftToLoad} is greater than 0:
  88.                     loop {spec::*}:
  89.                         teleport ("%loop-index%" parsed as player) to location at {_GoodLocation.Sky::%{_LeftToLoad}%}
  90.                         remove 1 from {_LeftToLoad}
  91.                     wait {@ChunkLoadTicks} ticks
  92.                     wait "%(size of {spec::*} - 1)*7% ticks" parsed as timespan
  93.             broadcast "{@H}Locations loaded. {@C}Now scattering."
  94.             loop {ToScatter::*}:
  95.                 set {Scatter.Scattering::%loop-value%} to true
  96.             wait 1 second
  97.             set {_time} to now
  98.             set {_Scattered} to 0
  99.             loop {_ToScatter::*}:
  100.                 set {_Player} to "%loop-value%" parsed as offlineplayer
  101.                 add 1 to {_Scattered}
  102.                 if {_Player} is not online:
  103.                     broadcast "    &7- {@H}%loop-value% &c-{@C} Scheduled Scatter"
  104.                     set {SchedueldScatter::%loop-value%} to location 1 above ({_GoodLocation.Sky::%{_Scattered}%})
  105.                 else:
  106.                     teleport (loop-value) to location 1 above ({_GoodLocation.Sky::%{_Scattered}%})
  107.                     barSquare({_GoodLocation.Sky::%{_Scattered}%})
  108.                     if {@BroadcastScatters} is true:
  109.                         broadcast "    &7- {@H}%loop-value%{@C} scattered."
  110.                 command "/scattersound"
  111.                 wait {@ScatterTicks} ticks
  112.             broadcast "{@C}Scatter has now {@H}finished! &c({@C}took {@H}%difference between now and {_time}%&c)"
  113.             delete {Scatter.Scattering::*}
  114.             delete {Scatter.DontUnloadChunks}
  115.             reveal all players to all players
  116. #------------------------- 
  117. #        Teams
  118. #-------------------------
  119.         else if arg-2 is "teams" or "t" or "team":
  120.             if size of {spec::*} is 0:
  121.                 if arg-3 is "-load":
  122.                     set {_fail} to false
  123.                 {_fail} is not set
  124.                 send "&7Scatter failed. No spectators to load chunks found. Use -load in the scatter to override this." to all ops
  125.                 stop trigger
  126.             set {_Count} to 0
  127.             loop {Teams::*}:
  128.                 team loop-value is set
  129.                 increase {_Count} by 1
  130.                 set {_TeamScatter.%{_Count}%::*} to (team loop-value)
  131.             loop all players:
  132.                 {Teams.InTeam::%loop-player%} is not set
  133.                 {spec::%loop-player%} is not set
  134.                 set {_Solos::%loop-player%} to loop-player
  135.             set {_Size} to ({_Count}+(size of {_Solos::*}))
  136.             set {_Mindist} to (arg-1/{_Size})*3.5
  137.             hide all players from all players
  138.             broadcast "{@C}Scattering {@H}%{_Count}%{@C} teams and {@H}%size of {_Solos::*}%{@C} solos with {@H}%{_Mindist}%{@C} mindist!"
  139.             loop ({_Size}) times:
  140.                 loop {@MaxTries} times:
  141.                     if (loop-number-2) is {@MaxTries}:
  142.                         broadcast "{@C}Couldn't find locations for {@H}%({_Size})-(loop-number-1)%&0/{@H}%{_Size}%{@C} teams/solos!"
  143.                         stop trigger
  144.                     set {_Location.Good} to true
  145.                     set {_Location.Good} to true
  146.                     set {_XR} to random integer between {midx} + arg-1 and {midx} - arg-1
  147.                     set {_YR} to 250
  148.                     set {_ZR} to random integer between {midz} + arg-1 and {midz} - arg-1
  149.                     evaluate "set {_Location.Sky} to location at {_XR}, {_YR}, {_ZR} of the world ""uhc"""
  150.                     loop ((loop-number-1)-1) times:
  151.                         (distance between {_Location.Sky} and {_GoodLocation.Sky::%loop-number-3%}) is less than ({_Mindist})
  152.                         delete {_Location.Good}
  153.                     if {_Location.Good} is true:
  154.                         set {_GoodLocation.Sky::%loop-number-1%} to ({_Location.Sky})
  155.                         stop loop
  156.             set {Scatter.DontUnloadChunks} to true
  157.             if {@LoadChunks} is true:
  158.                 ({_Size}) is more than {@DontLoadUnder}
  159.                 set {_ExpectedTime} to ({_Size})*({@ChunkLoadTicks}/20)
  160.                 broadcast "{@C}Locations found, starting to load chunks!"
  161.                 broadcast "{@C}Loading chunks should take {@H}~%{_ExpectedTime}/size of {spec::*}%{@C} seconds."
  162.                 set {_LeftToLoad} to {_Size}
  163.                 while {_LeftToLoad} is greater than 0:
  164.                     loop {spec::*}:
  165.                         teleport ("%loop-index%" parsed as player) to location at {_GoodLocation.Sky::%{_LeftToLoad}%}
  166.                         remove 1 from {_LeftToLoad}
  167.                     wait {@ChunkLoadTicks} ticks
  168.                     wait "%(size of {spec::*} - 1)*7% ticks" parsed as timespan
  169.             broadcast "{@H}Locations loaded. {@C}Now scattering."
  170.             loop all players:
  171.                 set {Scatter.Scattering::%loop-player%} to true
  172.             wait 1 second
  173.             set {_TeamSize} to (size of {_Scatter.Teams::*})
  174.             set {_SoloSize} to (size of {_Solos::*})
  175.             set {_PositionCount} to 0
  176.             set {_TeamCount} to 0
  177.             set {_SoloCount} to 0
  178.             set {_time} to now
  179.             loop {_Count} times:
  180.                 increase {_PositionCount} by 1
  181.                 increase {_TeamCount} by 1
  182.                 if {@BroadcastScatters} is true:
  183.                     broadcast "{@C}Scattering Team {@H}%{_TeamCount}%{@C}:"
  184.                 loop {_TeamScatter.%{_TeamCount}%::*}:
  185.                     set {_Player} to ("%loop-value-2%" parsed as offlineplayer)
  186.                     if {_Player} is not online:
  187.                         broadcast "    &7- {@H}%{_Player}% &c-{@C} Scheduled Scatter."
  188.                         set {SchedueldScatter::%{_Player}%} to location 1 above ({_GoodLocation.Sky::%{_PositionCount}%})
  189.                         command "/scattersound"
  190.                         wait {@ScatterTicks} ticks
  191.                     else:
  192.                         teleport {_Player} to location 1 above ({_GoodLocation.Sky::%{_PositionCount}%})
  193.                         barSquare({_GoodLocation.Sky::%{_PositionCount}%})
  194.                         if {@BroadcastScatters} is true:
  195.                             broadcast "    &7- {@H}%{_Player}%{@C} scattered."
  196.                         command "/scattersound"
  197.                         wait {@ScatterTicks} ticks
  198.             loop {_Solos::*}:
  199.                 increase {_PositionCount} by 1
  200.                 increase {_SoloCount} by 1
  201.                 if loop-value is not online:
  202.                     broadcast "    &7- {@H}%loop-value% &c-{@C} Scheduled Scatter. &a&l(SOLO)"
  203.                     set {SchedueldScatter::%loop-value%} to location 1 above ({_GoodLocation.Sky::%{_PositionCount}%})
  204.                     command "/scattersound"
  205.                 else:
  206.                     teleport loop-value to location 1 above ({_GoodLocation.Sky::%{_PositionCount}%})
  207.                     barSquare({_GoodLocation.Sky::%{_PositionCount}%})
  208.                     if {@BroadcastScatters} is true:
  209.                         broadcast "    &7- {@H}%loop-value%{@C} scattered. &a&l(SOLO)"
  210.                     command "/scattersound"
  211.                     wait {@ScatterTicks} ticks
  212.             broadcast "{@C}Scatter has now {@H}finished! &c({@C}took {@H}%difference between now and {_time}%&c)"
  213.             delete {Scatter.Scattering::*}
  214.             delete {Scatter.DontUnloadChunks}
  215.             reveal all players to all players
  216. #-------------------------
  217. #     Soul Brothers
  218. #-------------------------
  219.         else if arg-2 is "soul" or "brothers" or "soulbrothers" or "sb":
  220.             if size of {spec::*} is 0:
  221.                 if arg-3 is "-load":
  222.                     set {_fail} to false
  223.                 {_fail} is not set
  224.                 send "&7Scatter failed. No spectators to load chunks found. Use -load in the scatter to override this." to all ops
  225.                 stop trigger
  226.             set {_Count} to 0
  227.             loop {Teams::*}:
  228.                 team loop-value is set
  229.                 increase {_Count} by 1
  230.                 set {_TeamScatter.%{_Count}%::*} to (team loop-value)
  231.             loop all players:
  232.                 {Teams.InTeam::%loop-player%} is not set
  233.                 {spec::%loop-player%} is not set
  234.                 set {_Solos::%loop-player%} to loop-player
  235.             hide all players to all players
  236.             set {_Size} to ({_Count}+(size of {_Solos::*}))
  237.             set {_Mindist} to (arg-1/{_Size})*3.5
  238.             broadcast "{@C}Scattering {@H}%{_Count}%{@C} teams and {@H}%size of {_Solos::*}%{@C} solos with {@H}%{_Mindist}%{@C} mindist!"
  239.             loop ({_Size}) times:
  240.                 loop {@MaxTries} times:
  241.                     if (loop-number-2) is {@MaxTries}:
  242.                         broadcast "{@C}Couldn't find locations for {@H}%({_Size})-(loop-number-1)%&0/{@H}%{_Size}%{@C} teams/solos!"
  243.                         stop trigger
  244.                     set {_Location.Good} to true
  245.                     set {_Location.Good} to true
  246.                     set {_XR} to random integer between 0 + arg-1 and 0 - arg-1
  247.                     set {_YR} to 250
  248.                     set {_ZR} to random integer between 0 + arg-1 and 0 - arg-1
  249.                     evaluate "set {_Location.Sky} to location at {_XR}, {_YR}, {_ZR} of the world ""uhc3"""
  250.                     loop ((loop-number-1)-1) times:
  251.                         (distance between {_Location.Sky} and {_GoodLocation.Sky::%loop-number-3%}) is less than ({_Mindist})
  252.                         delete {_Location.Good}
  253.                     if {_Location.Good} is true:
  254.                         set {_GoodLocation.Sky::%loop-number-1%} to ({_Location.Sky})
  255.                         stop loop
  256.             set {Scatter.DontUnloadChunks} to true
  257.             if {@LoadChunks} is true:
  258.                 ({_Size}) is more than {@DontLoadUnder}
  259.                 set {_ExpectedTime} to ({_Size})*({@ChunkLoadTicks}/20)
  260.                 broadcast "{@C}Locations found, starting to load chunks!"
  261.                 broadcast "{@C}Loading chunks should take {@H}~%{_ExpectedTime}/size of {spec::*}%{@C} seconds."
  262.                 set {_LeftToLoad} to {_Size}
  263.                 while {_LeftToLoad} is greater than 0:
  264.                     loop {spec::*}:
  265.                         teleport ("%loop-index%" parsed as player) to location at {_GoodLocation.Sky::%{_LeftToLoad}%}
  266.                         remove 1 from {_LeftToLoad}
  267.                     wait {@ChunkLoadTicks} ticks
  268.                     wait "%(size of {spec::*} - 1)*7% ticks" parsed as timespan
  269.             broadcast "{@H}Locations loaded. {@C}Now scattering."
  270.             loop all players:
  271.                 set {Scatter.Scattering::%loop-player%} to true
  272.             wait 1 second
  273.             set {_TeamSize} to (size of {_Scatter.Teams::*})
  274.             set {_SoloSize} to (size of {_Solos::*})
  275.             set {_PositionCount} to 0
  276.             set {_TeamCount} to 0
  277.             set {_SoloCount} to 0
  278.             set {_time} to now
  279.             loop {_Count} times:
  280.                 increase {_PositionCount} by 1
  281.                 increase {_TeamCount} by 1
  282.                 if {@BroadcastScatters} is true:
  283.                     broadcast "{@C}Scattering Team {@H}%{_TeamCount}%{@C}:"
  284.                 loop {_TeamScatter.%{_TeamCount}%::*}:
  285.                     set {_Player} to ("%loop-value-2%" parsed as offlineplayer)
  286.                     add 1 to {_Team::%{_TeamCount}%}
  287.                     if {_Team::%{_TeamCount}%} is 1:
  288.                         if {_Player} is not online:
  289.                             broadcast "    &7- {@H}%{_Player}% &c-{@C} Scheduled Scatter."
  290.                             set {SchedueldScatter::%{_Player}%} to location 1 above ({_GoodLocation.Sky::%{_PositionCount}%})
  291.                             barSquare(({_GoodLocation.Sky::%{_PositionCount}%}))
  292.                             command "/scattersound"
  293.                             wait {@ScatterTicks} ticks
  294.                         else:
  295.                             teleport {_Player} to location 1 above ({_GoodLocation.Sky::%{_PositionCount}%})
  296.                             barSquare({_GoodLocation.Sky::%{_PositionCount}%})
  297.                             if {@BroadcastScatters} is true:
  298.                                 broadcast "    &7- {@H}%{_Player}%{@C} scattered."
  299.                             command "/scattersound"
  300.                             wait {@ScatterTicks} ticks
  301.                     else:
  302.                         set {_x} to x-coordinate of {_GoodLocation.Sky::%{_PositionCount}%}
  303.                         set {_y} to y-coordinate of {_GoodLocation.Sky::%{_PositionCount}%} + 1
  304.                         set {_z} to z-coordinate of {_GoodLocation.Sky::%{_PositionCount}%}
  305.                         evaluate "set {_loc} to location at {_x}, {_y}, {_z} of the world ""uhc2"""
  306.                         if {_Player} is not online:
  307.                             broadcast "    &7- {@H}%{_Player}% &c-{@C} Scheduled Scatter."
  308.                             set {SchedueldScatter::%{_Player}%} to {_loc}
  309.                             barSquare(location 1 below {_loc})
  310.                             command "/scattersound"
  311.                             wait {@ScatterTicks} ticks
  312.                         else:
  313.                             teleport {_Player} to {_loc}
  314.                             barSquare(location 1 below {_loc})
  315.                             if {@BroadcastScatters} is true:
  316.                                 broadcast "    &7- {@H}%{_Player}%{@C} scattered."
  317.                             command "/scattersound"
  318.                             wait {@ScatterTicks} ticks
  319.             loop {_Solos::*}:
  320.                 increase {_PositionCount} by 1
  321.                 increase {_SoloCount} by 1
  322.                 if loop-value is not online:
  323.                     broadcast "    &7- {@H}%loop-value% &c-{@C} Scheduled Scatter. &a&l(SOLO)"
  324.                     set {SchedueldScatter::%loop-value%} to location 1 above ({_GoodLocation.Sky::%{_PositionCount}%})
  325.                     command "/scattersound"
  326.                 else:
  327.                     teleport loop-value to location 1 above ({_GoodLocation.Sky::%{_PositionCount}%})
  328.                     barSquare({_GoodLocation.Sky::%{_PositionCount}%})
  329.                     if {@BroadcastScatters} is true:
  330.                         broadcast "    &7- {@H}%loop-value%{@C} scattered. &a&l(SOLO)"
  331.                     command "/scattersound"
  332.                     wait {@ScatterTicks} ticks
  333.             broadcast "{@C}Scatter has now {@H}finished! &c({@C}took {@H}%difference between now and {_time}%&c)"
  334.             delete {Scatter.Scattering::*}
  335.             delete {Scatter.DontUnloadChunks}
  336.             reveal all players to all players
  337.         else if arg-2 is "soul2" or "brothers2" or "soulbrothers2" or "sb2":
  338.             if size of {spec::*} is 0:
  339.                 if arg-3 is "-load":
  340.                     set {_fail} to false
  341.                 {_fail} is not set
  342.                 send "&7Scatter failed. No spectators to load chunks found. Use -load in the scatter to override this." to all ops
  343.                 stop trigger
  344.             set {_Count} to 0
  345.             loop {Teams::*}:
  346.                 team loop-value is set
  347.                 increase {_Count} by 1
  348.                 set {_TeamScatter.%{_Count}%::*} to (team loop-value)
  349.             loop all players:
  350.                 {Teams.InTeam::%loop-player%} is not set
  351.                 {spec::%loop-player%} is not set
  352.                 set {_Solos::%loop-player%} to loop-player
  353.             hide all players from all players
  354.             set {_Size} to ({_Count}+(size of {_Solos::*}))
  355.             set {_Mindist} to (arg-1/{_Size})*3.5
  356.             broadcast "{@C}Scattering {@H}%{_Count}%{@C} teams and {@H}%size of {_Solos::*}%{@C} solos with {@H}%{_Mindist}%{@C} mindist!"
  357.             loop ({_Size}) times:
  358.                 loop {@MaxTries} times:
  359.                     if (loop-number-2) is {@MaxTries}:
  360.                         broadcast "{@C}Couldn't find locations for {@H}%({_Size})-(loop-number-1)%&0/{@H}%{_Size}%{@C} teams/solos!"
  361.                         stop trigger
  362.                     set {_Location.Good} to true
  363.                     set {_Location.Good} to true
  364.                     set {_XR} to random integer between {midx} + arg-1 and {midx} - arg-1
  365.                     set {_YR} to 250
  366.                     set {_ZR} to random integer between {midz} + arg-1 and {midz} - arg-1
  367.                     evaluate "set {_Location.Sky} to location at {_XR}, {_YR}, {_ZR} of the world ""uhc"""
  368.                     loop ((loop-number-1)-1) times:
  369.                         (distance between {_Location.Sky} and {_GoodLocation.Sky::%loop-number-3%}) is less than ({_Mindist})
  370.                         delete {_Location.Good}
  371.                     if {_Location.Good} is true:
  372.                         set {_GoodLocation.Sky::%loop-number-1%} to ({_Location.Sky})
  373.                         stop loop
  374.             set {Scatter.DontUnloadChunks} to true
  375.             if {@LoadChunks} is true:
  376.                 ({_Size}) is more than {@DontLoadUnder}
  377.                 set {_ExpectedTime} to ({_Size})*({@ChunkLoadTicks}/20)
  378.                 broadcast "{@C}Locations found, starting to load chunks!"
  379.                 broadcast "{@C}Loading chunks should take {@H}~%{_ExpectedTime}/size of {spec::*}%{@C} seconds."
  380.                 set {_LeftToLoad} to {_Size}
  381.                 while {_LeftToLoad} is greater than 0:
  382.                     loop {spec::*}:
  383.                         teleport ("%loop-index%" parsed as player) to location at {_GoodLocation.Sky::%{_LeftToLoad}%}
  384.                         remove 1 from {_LeftToLoad}
  385.                     wait {@ChunkLoadTicks} ticks
  386.                     wait "%(size of {spec::*} - 1)*7% ticks" parsed as timespan
  387.             broadcast "{@H}Locations loaded. {@C}Now scattering."
  388.             loop all players:
  389.                 set {Scatter.Scattering::%loop-player%} to true
  390.             wait 1 second
  391.             set {_TeamSize} to (size of {_Scatter.Teams::*})
  392.             set {_SoloSize} to (size of {_Solos::*})
  393.             set {_PositionCount} to 0
  394.             set {_TeamCount} to 0
  395.             set {_SoloCount} to 0
  396.             set {_time} to now
  397.             loop {_Count} times:
  398.                 increase {_PositionCount} by 1
  399.                 increase {_TeamCount} by 1
  400.                 if {@BroadcastScatters} is true:
  401.                     broadcast "{@C}Scattering Team {@H}%{_TeamCount}%{@C}:"
  402.                 loop {_TeamScatter.%{_TeamCount}%::*}:
  403.                     set {_Player} to ("%loop-value-2%" parsed as offlineplayer)
  404.                     add 1 to {_Team::%{_TeamCount}%}
  405.                     set {nofall::%loop-value-2%} to true
  406.                     if {_Player} is not online:
  407.                         broadcast "    &7- {@H}%{_Player}% &c-{@C} Scheduled Scatter."
  408.                         set {SchedueldScatter::%{_Player}%} to location 1 above ({_GoodLocation.Sky::%{_PositionCount}%})
  409.                     else:
  410.                         teleport {_Player} to location 1 above ({_GoodLocation.Sky::%{_PositionCount}%})
  411.                         if {@BroadcastScatters} is true:
  412.                             broadcast "    &7- {@H}%{_Player}%{@C} scattered."
  413.                         command "/scattersound"
  414.                         wait {@ScatterTicks} ticks
  415.             loop {_Solos::*}:
  416.                 increase {_PositionCount} by 1
  417.                 increase {_SoloCount} by 1
  418.                 set {nofall::%loop-value%} to true
  419.                 if loop-value is not online:
  420.                     broadcast "    &7- {@H}%loop-value% &c-{@C} Scheduled Scatter. &a&l(SOLO)"
  421.                     set {SchedueldScatter::%loop-value%} to location 1 above ({_GoodLocation.Sky::%{_PositionCount}%})
  422.                     command "/scattersound"
  423.                 else:
  424.                     teleport loop-value to location 1 above ({_GoodLocation.Sky::%{_PositionCount}%})
  425.                     if {@BroadcastScatters} is true:
  426.                         broadcast "    &7- {@H}%loop-value%{@C} scattered. &a&l(SOLO)"
  427.                     command "/scattersound"
  428.                     wait {@ScatterTicks} ticks
  429.             broadcast "{@C}Scatter has now {@H}finished! &c({@C}took {@H}%difference between now and {_time}%&c)"
  430.             delete {Scatter.Scattering::*}
  431.             delete {Scatter.DontUnloadChunks}
  432.             reveal all players to all players
  433. #------------------------- 
  434. #      1 person
  435. #-------------------------
  436.         else if ("%arg-2%" parsed as offlineplayer) is online:
  437.             broadcast "{@C}Scattering {@H}%arg-2%{@C} with radius {@H}%arg-1%"
  438.             loop {@MaxTries} times:
  439.                 if (loop-number-2) is {@MaxTries}:
  440.                     broadcast "{@C}Couldn't find a location for {@H}%arg-2%"
  441.                     stop trigger
  442.                 set {_Location.Good} to true
  443.                 set {_XR} to random integer between {midx} + arg-1 and {midx} - arg-1
  444.                 set {_YR} to 250
  445.                 set {_ZR} to random integer between {midz} + arg-1 and {midz} - arg-1
  446.                 evaluate "set {_Location.Sky} to location at {_XR}, {_YR}, {_ZR} of the world ""uhc"""
  447.                 if {_Location.Good} is true:
  448.                     set {_GoodLocation.Sky} to ({_Location.Sky})
  449.                     stop loop
  450.             set {nodamage::%arg-2%} to true
  451.             teleport ("%arg-2%" parsed as offlineplayer) to ({_GoodLocation.Sky})
  452.             if {@BroadcastScatters} is true:
  453.                 broadcast "    &7- {@H}%arg-2%{@C} scattered."
  454.             command "/scattersound"
  455.             wait 30 seconds
  456.             wait 30 seconds
  457.             delete {nodamage::%arg-2%}
  458.         else:
  459.             send "{@Error} Couldnt get {@H}&0&l""{@C}%arg-2%&0&l""{@H}"
  460.             send "{@Error} /sca <radius> <teams/*/player name/sb/sb2> [-load]"
  461.            
  462. on skript load:
  463.     delete {Scatter.DontUnloadChunks}
  464.     delete {Scatter.Scattering::*}
  465.     delete {nodamage::*}
  466.     delete {nofall::*}
  467.    
  468. command /scattersound:
  469.     permission: scatter.sound
  470.     trigger:
  471.         {@Sounds} is true
  472.         loop all players:
  473.             command "/playsound {@ScatterSound} %loop-player% ~ ~ ~ {@SoundVolume} {@SoundPitch} {@SoundVolume}"
  474.        
  475. on chat:
  476.     {Scatter.Scattering::*} is set
  477.     set {nochat::%player%} to true
  478.        
  479. on damage of a player:
  480.     if {nodamage::%victim%} is true:
  481.         cancel the event
  482.     if damage cause is fall:
  483.         {nofall::%victim%} is true
  484.         cancel the event
  485.         delete {nofall::%victim%}
  486.        
  487. on login:
  488.     if {SchedueldScatter::%player%} is set:
  489.         teleport (player) to ({SchedueldScatter::%player%})
  490.         set {nodamage::%player%} to true
  491.         delete {SchedueldScatter::%player%}
  492.         broadcast "{@H}%player%{@C} has been scheduled a late scatter!"
  493.         command "/scattersound"
  494.         wait 30 seconds
  495.         delete {nodamage::%player%}
  496.     else if {SafeFromDeath::%player%} is true:
  497.         set {nodamage::%player%} to true
  498.         wait 30 seconds
  499.         delete {nodamage::%player%}
  500.            
  501. on join:
  502.     if {Scatter.Scattering::*} is set:
  503.         hide player from all players
  504.     else if {Scatter.DontUnloadChunks} is true:
  505.         hide player from all players
  506.            
  507. on quit:
  508.     if {Scatter.Scattering::*} is set:
  509.         set {SafeFromDeath::%player%} to true
  510.         reveal player to all players
  511.     else if {Scatter.DontUnloadChunks} is true:
  512.         set {SafeFromDeath::%player%} to true
  513.         reveal player to all players
  514.     delete {Scatter.Scattering::%player%}
  515.    
  516.            
  517. on chunk unload:
  518.     {Scatter.DontUnloadChunks} is true
  519.     cancel the event
  520.    
  521. on damage of a player:
  522.     {Scatter.Scattering::%victim%} is true
  523.     cancel the event
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top