--function debug() endfunction debug(...) print(...) if type(arg[1]) == "table" then PrintTable(arg[1]) endfunction GM:PlayerSelectSpawn( pl ) Msg("Selecting Spawn...\n") // Move to a spawn point (Depending on their team) local spawnpointEnt = "info_player_start" if( pl:Team() == TEAM_BLUE ) then spawnpointEnt = "info_blue_spawn" elseif( pl:Team() == TEAM_RED ) then spawnpointEnt = "info_red_spawn" end local spawns = ents.FindByClass( spawnpointEnt ) debug("spawnpointEnt:", spawnpointEnt ) -- Print spawnpoint ent class debug(spawns) -- print list of found spawnpoints return spawns[ math.random( 1, #spawns ) ]end