About team.SetSpawnPoint?

Hello, I’m trying to set spawn points for each team in my gamemode, but team.SetSpawnPoint seem not to work. Here is the code:

[lua]function GM:CreateTeams()

TEAM_WAIT = 1
team.SetUp( TEAM_WAIT, "Waiting", Color( 0, 0, 255 ) )
team.SetSpawnPoint( TEAM_WAIT, "info_player_counterterrorist" ) 

TEAM_BUILD = 2
team.SetUp( TEAM_BUILD, "Builders", Color( 255, 150, 0 ) )
team.SetSpawnPoint( TEAM_BUILD, "info_player_counterterrorist" ) 

TEAM_ATTACK = 3
team.SetUp( TEAM_ATTACK, "Attackers", Color( 255, 150, 150 ) )
team.SetSpawnPoint( TEAM_ATTACK, "info_player_terrorist" ) 

end[/lua]

Use [lua****] and [/****lua] tags.

Doit the cool way:
[lua]
function GM:PlayerSpawn(ply)
if ply:Team() == TEAM_WAIT then
local points = ents.FindByClass(“info_player_counterterrorist”)
ply:SetPos(points[math.random(1,#points)])
end
end
[/lua]

Thanks it worked, but after putting :GetPos() after points[math.random(1,#points)]
Like this:

[lua]
function GM:PlayerSpawn(ply)
if ply:Team() == TEAM_WAIT then
local points = ents.FindByClass(“info_player_counterterrorist”)
ply:SetPos(points[math.random(1,#points)]:GetPos())
end
end
[/lua]

Ah yeah, forgot that.