Arma 3 Scripting

Command in Object Manipulation

damage

Also available as Markdown and JSON, or read the original wiki page.

Description

Return the damage value of an object.

Syntax

damage object

Parameters:

Returns: Number - the returned number in range (healthy) 0..1 (dead).

Examples

Example 1

? damage player > 0.1 : player groupChat "I'm hurt! Medic!"

Example 2

if (damage player > 0.1) then
{
    player groupChat "I'm hurt! Medic!";
};

Example 3

private _health = (1 - damage player) * 100; // health in % from 0 to 100

See also

setDamage · setHit · getHit · getHitIndex · setHitIndex · getHitPointDamage · setHitPointDamage · waterDamaged · Arma 3: Event Handlers

Community notes

Pierre MGI

The returned value depends on the couple target/ammo fired. This value has no correlation with the sum of all hitpoints damage status and the effective status of the object. Firing bullets on cars often lead to weird results. For example: damage returns zero while a Hunter is fired at will with an .50 HMG! Hunter can be almost destroyed with zero damage for this function. If you script, use instead the getHitPointDamage command.