From Garry's Mod
Revision as of 19:02, 13 October 2015 by Robotboy655
Called to determine a spawn point for a player to spawn at.
The player who needs a spawn point
The spawnpoint entity to spawn the player at
Find a random spawn point
function GM:PlayerSelectSpawn( pl ) local spawns = ents.FindByClass( "info_player_start" ) local random_entry = math.random( #spawns ) return spawns[ random_entry ] end