I have one problem with a timer I made.
There are no errors to begin with just to make it clear.
So here is the code:
[lua]function AutoTeamSelection( ply )
if ply:Team() == TEAM_UNASSIGNED then timer.Create( ply:SteamID().."Auto", 9, 1, ply:SetTeam( math.random( 1, 2 ) ) ) else timer.Destroy( ply:SteamID().."Auto" ) return end
hook.Add( “PlayerSpawn”, “AutoTeamSelect”, AutoTeamSelection )[/lua]
Now of course, bear in mind that this snippet of code is experimental.
The problem is, the timer dosen’t seem to start but executes the function right away as if I had never put the ply:SetTeam() in the timer.
I might be doing something wrong, may someone help me out?