Player::applyDamageTo: Difference between revisions

From RAGE Multiplayer Wiki
Line 11: Line 11:
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// player health: 100, armor: 100
// player health: 100, armor: 100
player.applyDamageTo(25, false);
player.applyDamageTo(25, false);
// player health: 75, armor: 100
// player health: 75, armor: 100
player.applyDamageTo(25, true);
player.applyDamageTo(25, true);
// player health: 75, armor: 75
// player health: 75, armor: 75

Revision as of 11:22, 9 January 2023

Syntax

player.applyDamageTo(damageAmount, withArmor);

Required Arguments

  • damageAmount: int
  • withArmor: Boolean

Return value

  • Undefined

Example

// player health: 100, armor: 100

player.applyDamageTo(25, false);
// player health: 75, armor: 100

player.applyDamageTo(25, true);
// player health: 75, armor: 75

See also