OnTakeDamage not called for non-physics damage on SENTs?

Is there a fix/workaround for this?

Are you sure http://wiki.garrysmod.com/?title=Gamemode.EntityTakeDamage doesn’t work?

Yep.

[lua]
function EntityTakeDamageTest( ent, inflictor, attacker, amount, dmginfo )
print(“Derp”)
end
hook.Add( “EntityTakeDamage”, “EntityTakeDamage_Test”, EntityTakeDamageTest )
[/lua]

‘Derp’ is only printed if it gets blown up or hit by a projectile. Hitscan weapons do sparks but no damage.

Did you add [lua]self:TakePhysicsDamage(dmginfo)[/lua] somewhere in the Entity.OnTakeDamage function? As far as I know that works for my sents that take damage with normal hl2 weapons and other things.

Yep

[lua]

function ENT:OnTakeDamage(dmg)
self:TakePhysicsDamage(dmg);
if(self:Health() <= 0) then return; end
self:SetHealth(self:Health() - dmg:GetDamage())
end
[/lua]

I’ll look into it when I get home.

What type of entity is it? Like anim, point, brush or AI?

anim