How to make snpc's spawn in gamemode

One quick question, How can i make a Scripted npc spawn at info_player_terrorist? And the regular player spawn at info_player_spawn?

I’m just wondering :slight_smile:

[LUA]
local npcspawns = ents.FindByClass(“info_player_terrorist”)
for k,v in pairs(npcspawns)do
npcspawns[k] = npcspawns:GetPos()
end
[/LUA]
[LUA]
local npc = ents.Create(“your_npc_class_here”)
npc:SetPos(npcspawns[math.random(1,#npcspawns)])
npc:SetModel(“your_model_here.mdl”)
npc:Spawn()
npc:Activate()
[/LUA]

Ok thank you so much!! I couldn’t find this anywhere :stuck_out_tongue: