Entity Spawner

Hey guys.

Im starting my severance server soon but unfortunatley the zombies ents have to be manually spawned. Could somebody show me how I would make an entity spawner in Garrys Mod?

Entity spawner. Not NPC spawner.

the zombies ents = NPC

Instead of posting back giving me some bullshit answer be more descriptive in your first post stating what you need instead of saying “the zombies ents”. What the fuck is that?

Then modify it.

Try it…


timer.Create("zombie_spawn", 15, 0, function() -- 15 - time in seconds before zombie spawn.. 0 - zombie spawn unlimited..
	z1() -- call function z1
end)

function z1()
	local ent = ents.Create("aura_zombie") -- define
	ent:SetPos(Vector(-2651.005615, -2193.302002, -109.968750)) -- spawn coordinates.. (Use: getpos)
	ent:Spawn() -- Entity spawn
end

Code will work. but you are not limiting the amount. Eventually if zombies are not killed, you will have a shitton. Add in some checks for the amount

You can create a timer to auto delete zombies every N time or if zombies will > N.

That’s a horrible implementation. Make it keep a record of which zombies are spawned. When they are killed, lower the count.

3 days on lua… =\