Garry's Mod Wiki


  GM:ScaleNPCDamage( NPC npc, number hitgroup, CTakeDamageInfo dmginfo )


Called when an NPC takes damage.

This hook is called only when a specific hit group of the NPC is hit. In cases where the hitgroup doesn't matter, you should use GM:EntityTakeDamage instead!


1 NPC npc
The NPC that takes damage
2 number hitgroup
The hitgroup (hitbox) enum where the NPC took damage. See HITGROUP enum
3 CTakeDamageInfo dmginfo
Damage info


Double the damage whenever an NPC is hurt.

hook.Add( "ScaleNPCDamage", "ScaleNPCDamageExample", function( npc, hitgroup, dmginfo ) dmginfo:ScaleDamage( 2 ) end )