I’ve been trying to get my gamemode to spawn NPCs at certain places on specified maps at random intervals, and i really have no idea how to do it, i tried doing this

```
function SpawnBandit()
local spawn = table.Random(BanditSpawns)
local pos = spawn:GetPos()
local angles = spawn:GetAngles()
local bandit = ents.Create("npc_banditenemy")
bandit:SetPos(pos)
bandit:SetAngles(angles)
bandit:Spawn()
end
```

I have no idea where i got that from though, any help?