How do I get an array of players on a team?

Hello so I know if I want to target a player in general I can use something like this

Playspace : fort_playspace = GetPlayspace()
            AllPlayers :  []player = Playspace.GetPlayers()
            if (FirstPlayer : player = AllPlayers[0]):

How would I use this logic for teams though? Is there a way to get an array of players on a specific team so I can target their agents to do things like this?

Teleport(Team2[0])

Thanks! :smiley:

1 Like

TeamCollection := GetPlaySpace().GetTeamCollection()
TeamCollection.GetAgents(Team)

TeamCollection := GetPlayspace().GetTeamCollection()
TeamPlayers := TeamCollection.GetAgents(MyTeam)

fixed formatting

1 Like