EntityKeyValue??

I’m trying to use info_player_teamspawn(Which has values for team spawning) and its using a map with “info_player_teamspawn” and I need to use GM:EntityKeyValue( Entity ent, string key, string value )
I have no clue how to use this, I’ve only gotten this far with it " GM:EntityKeyValue( info_player_teamspawn, string key, string value ) "
Any help anyone please and thanks:)


 local spawns = ents.FindByClass( "info_player_start" ) --Make so that we can use spawns instead of info_player_start (they will do the same things)
     local random = math.random(spawns) --Random spawn of the info_player_start  
 
if ply:Team() == 1 --If player is in team 1
then
 
spawns[random] --Make them always spawn from a random point of this class


I was planning to alter this to work with the team spawn so if your team value is 2, you go to the teamspawn’s correct team which is red since tf2 maps use 2 for red,3 for blue and im using a tf2 map. Im a noobie i know<3

Here is how you’d use the built in PlayerSelectSpawn game-mode function properly:
https://dl.dropboxusercontent.com/u/26074909/tutoring/_systems/playerselectspawn_system.lua.html

In the helper-function you could grab locations based on the team; I’d recommend caching the spawn-points so they are only looked up once. Use table.Random( ) to select a random spawn point from the two team spawn point locations…

Here’s a more… readable… version. TTT spawn system, it helps prevent players from spawning stuck in eachother.

I wasn’t going to give everything away; besides collision detection is half the fun!