Page tree
Skip to end of metadata
Go to start of metadata


Introduced in

Version:1.00

Description

Description:

Damages / repairs the specified object.

Damage of 0 means fully functional, damage of 1 means completely destroyed / dead.

Note: This command fixes the spelling error in setDammage and is identical to it.

Syntax

Syntax:object setDamage damage
Parameters:
  • object: Object - Object that receives the damage.
  • damage: Number - Amount of damage to apply.
Return Value:Nothing

Alternative Syntax

Syntax:unit setDamage [damage, hitBodyParts, attacker] (V2.10+)
Parameters:
  • unit : Unit - Unit that receives the damage.
  • damage: Number - Amount of damage to apply.
  • hitBodyParts: Boolean - Set to true by default; if false, overall damage is set but not applied to hit body parts.
  • attacker: Object - Object that causes the damage (optional).
Return Value:Object

Examples

Examples:
_soldier1 setDamage 1
_unit setDamage [1, false]

Additional Information

See also: setDammage, damage, getDammage, getHit
Multiplayer:
Problems:

Notes