1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  2. LOOKING FOR A VERSION OF SKRIPT??:

    You can always check our our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

It doesn't loop all players in the world

Discussion in 'Skript' started by MPGxxYT, Jul 20, 2019.

Tags:
Thread Status:
Not open for further replies.
  1. MPGxxYT

    MPGxxYT Member

    Joined:
    Feb 14, 2018
    Messages:
    4
    Likes Received:
    0
    LINE 24 - 26
    It doesn't loop all players yet in another skript that works


    Code (Text):
    1. command /play [<text>]:
    2.     trigger:
    3.         if {games::*} doesn't contain arg 1:
    4.             send "&cThat game does not exist."
    5.         else:
    6.             set {num.toggle.%uuid of player%} to true
    7.             if {lobby::%arg 1%::*} exists:
    8.                 set {_num} to 1
    9.                 set {_num2} to 0
    10.                 loop {lobby::%arg 1%::*}:
    11.                     set {lob.%{_num}%} to loop-value
    12.                     add 1 to {_num}
    13.                     add 1 to {_num2}
    14.                     send "%{_num}%"
    15.                     send "%{_num2}% I"
    16.                 loop {_num2} times:
    17.                     send "X"
    18.                     if {_num2} is greater than 0:
    19.                         send "A"
    20.                         if {num.toggle.%uuid of player%} is false:
    21.                             send "B"
    22.                             if {_num2} is 1:
    23.                                 send "C"
    24.                                 loop all players in {lob.%{_num2}%}:
    25.                                     add 1 to {lob.worldpl} #even if i'm in the world it says 0
    26.                                     send "J"
    27.                                 send "%{lob.%{_num2}%}%"
    28.                                 send "%{lob.worldpl}%"
    29.                                 add 1 to {lob.worldpl}
    30.                                 send "%{lob.worldpl}%"
    31.                                 if {lob.worldpl} is 1:
    32.                                     send "H"
    33.                                     set {lob.worldpl} to amount of all players in world {lob.%{_num}%}
    34.                                     if {lob.worldpl} is {max.%arg 1%}:
    35.                                         add 1 to {_num}
    36.                                         add 1 to {_num2}
    37.                                         send "%{_num}%"
    38.                                         send "%{_num2}% I"
    39.                                     else:
    40.                                         teleport player to world {lob.%{_num}%}
    41.                                         stop
    42.                             else:
    43.                                 send "Error 03B"
    44.                         else:
    45.                             send "Y"
    46.                             if {_num2} is less than {_num}:
    47.                                 send "M"
    48.                                 send "%{_num}%"
    49.                                 send "%{_num2}%"
    50.                                 if {num.toggle.%uuid of player%} is true:
    51.                                     set {_num} to 2
    52.                                     set {_num2} to 1
    53.                                     send "%{_num}%"
    54.                                     send "%{_num2}%"
    55.                                     set {num.toggle.%uuid of player%} to false
    56.                                 else:
    57.                                     send "L"
    58.                                     set {lob.worldpl} to amount of all players in world {lob.%{_num2}%}
    59.                                     if {lob.worldpl} is 1:
    60.                                         set {lob.worldpl} to amount of all players in world {lob.%{_num2}%}
    61.                                         if {lob.worldpl} is {max.%arg 1%}:
    62.                                             add 1 to {_num}
    63.                                             add 1 to {_num2}
    64.                                             send "%{_num}%"
    65.                                             send "%{_num2}% I"
    66.                                         else:
    67.                                             teleport player to world {lob.%{_num}%}
    68.                                             stop
    69.                                     else:
    70.                                         teleport player to world {lob.%{_num2}%}
    71.                                         stop
    72.                     else:
    73.                         send "&cNo lobbies exist for that game"
    74. command /addgame [<text>] [<number>]:
    75.     trigger:
    76.         add arg 1 to {games::*}
    77.         set {max.%arg 1%} to arg 2
    78.         send "&7Added &6%arg 1%&7 with max &6%arg 2%&7 to game list."
    79.         send "&7Make sure to add lobbies to your games."
    80.        
    81. command /addlobby [<text>] [<text>] [<number>]:
    82.     trigger:
    83.         set {lob.%arg 3%} to arg 2
    84.         add {lob.%arg 3%} to {lobby::%arg 1%::*}
    85.         send "&7Added &6%arg 2%&7 to &6%arg 1%&7's lobbies."
    86.        
    87. command /delgame [<text>] [<number>]:
    88.     trigger:
    89.         remove arg 1 from {games::*}
    90.         delete {max.%arg 1%}
    91.         delete {lobby::%arg 1%::*}
    92.         send "&7Removed &6%arg 1%&7 from game list."
    93.         send "&7Lobbies for &6%arg 1%&6 auto deleted."
    94.        
    95. command /dellobby [<text>] [<number>]:
    96.     trigger:
    97.         remove {lob.%arg 2%} from {lobby::%arg 1%::*}
    98.         send "&7Removed &6%arg 2%&7 from &6%arg 1%&7's lobbies."
    99.        
    100. command /lobbylist [<text>]:
    101.     trigger:
    102.         send "&fLobby List:"
    103.         loop {lobby::%arg 1%::*}:
    104.             send "&7%loop-value%"
    105.         send " "
    106.        
    107. command /gamelist:
    108.     trigger:
    109.         send "&fGame List:"
    110.         loop {games::*}:
    111.             send "&7%loop-value%"
    112.         send " "
     
  2. novastosha

    novastosha Well-Known Member

    Joined:
    Jan 11, 2019
    Messages:
    233
    Likes Received:
    11
    Code (Skript):
    1.  
    2. loop all players:
    3.     loop-player's world is {_var}:
    4.         #Do stuff
    5. [CODE]\
     
Thread Status:
Not open for further replies.
Loading...