• Why do I keep spawning on the terrorist spawn point with this snippet?
    0 replies, posted
[CODE]function GM:PlayerSelectSpawn( ply ) local TEAM_BLUE = 1 local TEAM_RED = 2 local TEAM_SPEC = 3 local blue = ents.FindByClass( "info_player_counterterrorist" ) local red = ents.FindByClass( "info_player_terrorist" ) local spec = ents.FindByClass( "info_player_start" ) local random_1 = math.random( #blue ) local random_2 = math.random( #red ) local random_3 = math.random( #spec ) if ply:Team() == TEAM_BLUE then return red[random_1] elseif ply:Team() == TEAM_RED then return blue[random_2] else return spec[random_3] end end[/CODE] Sorry, I've fiddled around with it forever and it just keeps spawning me on the wrong side, I've tried swapping vars and everything.. [editline]17th March 2015[/editline] Gah, nevermind this, I've figured it out!
Sorry, you need to Log In to post a reply to this thread.