put the count players in team functions into onPlayerLogin function, this.
a = createTeam ( "teamA", 0, 10, 200 )
b = createTeam ( "teamB", 0, 200, 10 )
function team (thePlayer)
aCount = countPlayersInTeam ( a )
bCount = countPlayersInTeam ( b )
if aCount == 0 then
setPlayerTeam" class="kw6">setPlayerTeam (thePlayer, a)
outputChatBox ("A", thePlayer, 255, 0, 0, true)
setElementPosition (thePlayer, 1021, 1120, 142)
setPlayerSkin (thePlayer, 184)
elseif bCount == 1 then
setPlayerTeam" class="kw6">setPlayerTeam (thePlayer , b)
setElementPosition (thePlayer, 100, 100, 100)
setPlayerSkin (thePlayer, 162)
end
end
addEventHandler( "onPlayerLogin", getRootElement(), team )