Help me assign players to different teams

so im making a 2v2 map and i have a team selector but if the players dont choose their teams manually, the code will just put all players in team 1


    OnTeamSelectionEnd(MaybeAgent:?agent):void=
        for(Player: GetPlayspace().GetPlayers()):
           if(Team1.Count()<2): 
                if(not Team1.FindOnTeam[Player]):
                    if(Agent:= agent[Player]):
                        Team1.TeamSelector.ChangeTeam(Agent)
            else if(Team2.Count()<2):
                if(not Team2.FindOnTeam[Player]):
                    if(Agent:= agent[Player]):
                        Team2.TeamSelector.ChangeTeam(Agent)

            Loadout.LoadoutTimer.Start()
            LoadoutSelectSpawners.Teleport(Player)
          

Are you using 2 team selectors 1 for each team ?.

no, each team has a different team selector

1 Like