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!

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

Solved Random teams red vs blue

Discussion in 'Requests' started by SoMuchWessel, Aug 15, 2018.

Tags:
  1. SoMuchWessel

    SoMuchWessel Active Member

    Joined:
    Apr 3, 2017
    Messages:
    147
    Likes Received:
    2
    Category: Teams

    Suggested name: teams.sk

    What I want:
    I want that people can join a lobby. If there are enough people the game will start. This part is already done.
    I want that there are 2 teams: Red and Blue.
    After the game starts, i want that everyone in {game::lobby::*} is random assigned to the red or the blue team.
    I would like to use the list variables {game::red::*} and {game::blue::*}.

    Ideas for commands: -

    Ideas for permissions: -

    When I'd like it by: As soon as possible
     
  2. Best Answer:
    Post #2 by TPGamesNL, Aug 15, 2018
  3. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,500
    Likes Received:
    102
    Medals:
    Is this good:
    Code (Skript):
    1. set {_l::*} to shuffled {game::lobby::*}
    2. loop {_l::*}:
    3.     set {_li} to loop-index parsed as a number
    4.     if mod({_li}, 2) = 0:
    5.         add loop-value to {game::blue::*}
    6.     else:
    7.         add loop-value to {game::red::*}
     
  4. SoMuchWessel

    SoMuchWessel Active Member

    Joined:
    Apr 3, 2017
    Messages:
    147
    Likes Received:
    2
    Thanks!

     
    • Friendly Friendly x 1

Share This Page

Loading...