How Do I Find/Create My Team's Index?

Hello. I’m creating a code for teams in my next gamemode, however I’ve come across a problem, where I know what to fix, I just don’t know how to fix it.
Here:
function GM:CreateTeams()
team.SetUp(1, “Combine”, Color(255, 0, 0) true)
team.SetSpawnPoint( 1, ( “info_player_terrorist” ) )
end

function ChangeMyTeam( ply, cmd, args )
ply:SetTeam( args[1] )
ply:Spawn()
end
concommand.Add( “set_team”, ChangeMyTeam

Apparently, the team needs to have an index where I have “1” in team.SetSpawnPoint. However, I have no idea how to find/create an index for this team. A little help, please?

I am having trouble understanding what you mean but if you are asking how do you get the team, then you can do this



TEAM_COMBINE = 1
function GM:CreateTeams()
    team.SetUp(1, "Combine", Color(255, 0, 0) true)
    team.SetSpawnPoint( TEAM_COMBINE, ( "info_player_terrorist" ) )
end


then you can use TEAM_COMBINE, that’s the index.