Godmode NPC

Hi, I am wondering what I can use to give an NPC godmode? I have tried many ways but failed every time.

If you’re spawning the npc with lua I would make the the npc global and then use **[Gamemode.ScaleNPCDamage

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Gamemode.ScaleNPCDamage)**

Example:
[lua]
hook.Add( “InitPostEntity”, “Spawn Npc”, function()
NPC = ents.Create(“npc_mossman”)
NPC:SetPos(Vector(200.2566, -156.4668, -63.9688))
NPC:Spawn()
end)

hook.Add(“ScaleNPCDamage”,“Unable to kill NPC”, function(npc,hitgroup,dmginfo )
if npc==NPC then
dmginfo:ScaleDamage( 0 )
end
end)
[/lua]

Also another question.

My NPC’s legs are sorta in the ground moving around. Any clue why that would happen?

[editline]08:26AM[/editline]

Also, I tried what you said Dragge in a Server-Side Folder and it did not work.

[editline]08:35AM[/editline]

Here, I got an image for ya.

http://img580.imageshack.us/img580/5337/legsc.th.png

Spawn him a little bit above the ground and let him drop down

I tryed that, he dosent move.

i have it with my SNPC, it IS because it’s too low in the ground, spawn it higher, then move it slowly down until it moves

I have spawned it extremely higher and it didnt make a difference, it just stayed there. So, are you saying even though I spawn it higher there will be no visible difference until I get it perfect?

[lua]
function ENT:TakeDamage() return end
[/lua]