I have a hook for multiple NPC's of mine, and they don't seem to work at all. I'm not sure the reason its not working is because i have it in the init.lua file or something weird.
hook.Add("EntityTakeDamage", "PleaseDontHurtMe", function(ent, dmginfo)
if IsValid(ent) and ent:GetName() == "Mechalion" and
(dmginfo:IsDamageType(DMG_GENERIC) or
dmginfo:IsDamageType(DMG_CRUSH) or
dmginfo:IsDamageType(DMG_BULLET) or
dmginfo:IsDamageType(DMG_SLASH) or
dmginfo:IsDamageType(DMG_BURN) or
dmginfo:IsDamageType(DMG_VEHICLE) or
dmginfo:IsDamageType(DMG_FALL) or
dmginfo:IsDamageType(DMG_BLAST) or
dmginfo:IsDamageType(DMG_CLUB) or
dmginfo:IsDamageType(DMG_SHOCK) or
dmginfo:IsDamageType(DMG_SONIC) or
dmginfo:IsDamageType(DMG_ENERGYBEAM) or
dmginfo:IsDamageType(DMG_PARALYZE) or
dmginfo:IsDamageType(DMG_NERVEGAS) or
dmginfo:IsDamageType(DMG_POISON) or
dmginfo:IsDamageType(DMG_AIRBOAT) or
dmginfo:IsDamageType(DMG_BLAST_SURFACE) or
dmginfo:IsDamageType(DMG_BUCKSHOT) or
dmginfo:IsDamageType(DMG_PLASMA) or
dmginfo:IsDamageType(DMG_NEVERGIB) or
dmginfo:IsDamageType(DMG_PREVENT_PHYSICS_FORCE) or
dmginfo:IsDamageType(DMG_REMOVENORAGDOLL) or
dmginfo:IsDamageType(DMG_SLOWBURN)) then
dmginfo:ScaleDamage(.55)
end
end)
hook.Add("EntityTakeDamage", "PleaseDontHurtMe", function(ent, dmginfo)
if IsValid(ent) and ent:GetName() == "Mechalion" and dmginfo:GetDamage() > 1 then
dmginfo:ScaleDamage(.55)
end
end)
Oh nice it works, I am stupid.
Thank you!
Sorry, you need to Log In to post a reply to this thread.