• Godmode NPC
    7 replies, posted
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 [b][url=wiki.garrysmod.com/?title=Gamemode.ScaleNPCDamage]Gamemode.ScaleNPCDamage [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] 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. [URL=http://img580.imageshack.us/i/legsc.png/][IMG]http://img580.imageshack.us/img580/5337/legsc.th.png[/IMG][/URL]
Spawn him a little bit above the ground and let him drop down
[QUOTE=King Flawless;23726119]Spawn him a little bit above the ground and let him drop down[/QUOTE] 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
[QUOTE=Ningaglio;23727348]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[/QUOTE] 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]
Sorry, you need to Log In to post a reply to this thread.