• Setting a team's spawn point?
    3 replies, posted
Say I wanted to make a Deathrun gamemode, and I wanted to have separate spawn points for T's and CT's. T's would spawn inside the trap area obviously, and CT's outside. How would I set it so that the teams spawn points are there? Where the info_player_terrorist thing is and etc? But I would have custom teams. like team.Setup().
[lua] function GM:PlayerSelectSpawn( pl ) if pl:Team() == 1 then local spawns = ents.FindByClass( "info_player_terrorist" ) local random_entry = math.random(#spawns) return spawns[random_entry] end end [/lua]
[code] function GM:PlayerSelectSpawn( pl ) if pl:Team() == 1 then local spawns = ents.FindByClass( "info_player_terrorist" ) local random_entry = math.random(#spawns) elseif pl:Team() == 2 then local spawns = ents.FindByClass( "info_player_counterterrorist" ) local random_entry = math.random(#spawns) else local spawns = ents.FindByClass( "info_player_start" ) local random_entry = math.random(#spawns) end return spawns[random_entry] end [/code] Fixed. The other guy half-assed it.
Thanks guys.
Sorry, you need to Log In to post a reply to this thread.