Garry's Mod Wiki

Garry's Mod Wiki

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

Description

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!

Arguments

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

Example

Double the damage whenever an NPC is hurt.

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

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...