NPC help?

Ok now im hosting a ZombieRP server. But i want to be different and add some of my own ideas and things.
What i need help with is i need help getting a NPC to stand in a location (in the town) and kill the zombies
So i want them to kinda be like a guard like to kill zombies that enter into the town. Now i know there are npc’s that will kill the people but i was looking to see if i could get one of the npc’s that dont kill people but they will shoot zombies. I know there are a couple im just wondering if there is a code for this.

Basically all the code needs to be is something that will spawn the npc on a certain location on the start of the server. And it wont walk around just stand there and i can set its location and the weapon its holding. Just wondering if this is possible to code?

Of course it’s possible.

Isn’t that the normal (hl2, already implemente) npcs?
How I remember it is was that if there comes a hostile and you have like father grigori standing there, he will try shoot them?
Or am I wrong?

not like that i want it so they stay on my server when i leave the server and when i join again it will still be in that spot. i want him to be where nobody can kill him not just a normal N

You should make a new scripted npc, i am on my phone now so i cant help you much but check out this for a basic npc maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index7853.html and study around the wiki for the rest.

Basic script that spawns the NPC:
[lua]
local function GrigoriSpawn()
if SERVER then
local grigori = ents.Create(“npc_monk”)–NPC
grigori:SetPos(Vector(0, 0, 0))-- Position
grigori:SetAngles(Angle(0, 0, 0))-- Angle
grigori:Spawn()
end
end
hook.Add( “InitPostEntity”, “SpawnEntities”, SpawnEntities)

timer.Simple(1, GrigoriSpawn)-- 1 is the delay the NPC spawns.
[/lua]

[editline]7th February 2013[/editline]

By the way it would go in something serverside or shared. Like an init.lua or shared .lua.