Hello. I currently have two entites spawned in my gamemode that are shopkeepers.
Here is the code I used to spawn them.
local merchant = ents.Create("npc_monk") merchant:SetPos(Vector( -2174, -10167, 419) ) merchant:SetHealth(9999999) -- This line didn't seem to do anything for me! :/ merchant:Give("weapon_shotgun") merchant:Spawn() merchant:DropToFloor() local merchant2 = ents.Create("npc_eli") merchant2:SetPos(Vector( -2206, -9914, 395) ) merchant2:SetAngles(Angle(4, -134, 0)) merchant2:SetHealth(9999999) -- The same thing applies here. merchant2:Give("weapon_smg1") merchant2:Spawn() merchant2:DropToFloor()
Despite apparently having 999999 health, they are still easily killed with a few shots to any part of their body. The head is a one hit kill.
I would only like to make these NPCs invincible, but after looking on Google and Facepunch for quite a while, the only solution I have been able to find is making them a scripted entity,
which, to be honest, I don’t really think I need, considering they do their job perfectly well as they are.
Therefore, is there a way to make an entity invincible (maybe by using a hook for when NPCs take damage? Not sure) without making them a scripted entity?
Any help would be most appreciated. Thanks.