GM:ScaleNPCDamage

From Garry's Mod
Jump to: navigation, search
 GM:ScaleNPCDamage( )

Contents

Description

Called when an NPC takes damage.

NOTE 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

NPC npc

The NPC that takes damage

Arguments

number hitgroup

The hitgroup (hitbox) enum where the player took damage. See HITGROUP_ Enums

Arguments

CTakeDamageInfo dmginfo

Damage info

Examples

Example

Double the damage whenever a NPC is hurt.

function GM:ScaleNPCDamage( npc, hitgroup, dmginfo )
	dmginfo:ScaleDamage( 2 )
end


Personal tools
Navigation