Garry's Mod Wiki

Garry's Mod Wiki

  boolean CTakeDamageInfo:IsDamageType( number dmgType )

Description

Returns whenever the damageinfo contains the damage type specified.

Arguments

1 number dmgType
Damage type to test. See DMG enum.

Returns

1 boolean
Whether this damage contains specified damage type or not

Example

All of these expressions are equivalent to each other, evaluating to true if the damageinfo contains bullet, explosive, or club damage:

dmginfo:IsBulletDamage() or dmginfo:IsExplosionDamage() or dmginfo:IsDamageType(DMG_CLUB)
dmginfo:IsDamageType(DMG_BULLET + DMG_BLAST + DMG_CLUB)
bit.band(dmginfo:GetDamageType(), bit.bor(DMG_BULLET, DMG_BLAST, DMG_CLUB)) ~= 0

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...