npc question

Is there any way to disable the blood impact effect on a specific NPC temporarily

its part of a defense system using shields and stuff for my game-mode i want to use a different effect until the NPC takes actual health damage

this is where i want to use it…


function GM:EntityTakeDamage( ent, inflictor, attacker, amount, dmginfo )
if ent:IsPlayer() then
ent.ShRegen = CurTime() + 3
end
    if ent:IsNPC() then
    local phys = ent:GetPhysicsObject()
    local distance = ent:GetPos():Distance(attacker:GetPos())
    local damage = (amount *attacker:GetNWInt("Lvl")/ent:GetNWInt("Lvl"))
                if ent:GetNWInt("npcshield") > 0 then
                ent:SetHealth(ent:Health() + dmginfo:GetDamage())
                ent:SetNWInt("npcshield",ent:GetNWInt("npcshield") - damage)
                
                local vPoint = attacker:GetEyeTrace()
                local effectdata = EffectData()
                effectdata:SetStart( vPoint.HitPos ) -- not sure if we need a start and origin (endpoint) for this effect, but whatever
                effectdata:SetOrigin( vPoint.HitPos )
                effectdata:SetScale( 1*(distance/100))
                timer.Simple(0.001*distance,function()
                util.Effect( "selection_ring", effectdata )
                ent:EmitSound("AlyxEMP.Charge")
                end)
                else
                randOx = math.random(-128,128)
                randOy = math.random(-128,128)
                randOz = math.random(-128,128)
                local vPoint = attacker:GetEyeTrace()
                local effectdata = EffectData()
                effectdata:SetStart( vPoint.HitPos ) -- not sure if we need a start and origin (endpoint) for this effect, but whatever
                effectdata:SetOrigin( vPoint.HitPos + vec(randOx,randOy,randOz))
                effectdata:SetScale( 3 )
                util.Effect( "bloodspray", effectdata )
        ent:SetNWString("npchealth",tostring(ent:Health() + amount - damage))
        ent:SetNWString("npcmaxhealth",tostring(ent:GetMaxHealth()))
        ent:SetColor(255,128,128,255)
            end

I would like to know this as well. I can’t figure out a way to stop the blood impact from showing on NPCs when they’re shot.

o.o this would be very helpful. Let’s pray to the lua lords of garrysmod.org!

**[Entity.SetBloodColor

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


ent:SetBloodColor(-1)

:eng101: