I’m working on a DM gamemode, and looking for a way to assign spawnpoints to teams in lua. So far i’ve added a keyvalue in the info_player_start ents called “team” (in hammer) with a value of either red or blue. I’ve been trying to retreive the values by doing:
for k,v in pairs(ents.FindByClass("info_player_start")) do print(v:GetKeyValues().team) if v:GetKeyValues().team == "red" then table.insert(RedSpawn,v) print("Red spawn added") end if v:GetKeyValues().team == "blue" then table.insert(BlueSpawn,v) print("Blue spawn added") end end
I know I’m getting the correct ents, but i cant get the keyvalues, so i was wondering how i’d get that to work.
Thanks in advance!