Skip to content
On this page

Battle Commands


Apply Damage

  • Method: player.applyDamage(attackerPlayer,skill)
  • Arguments:
    • { RpgPlayer} attackerPlayer. The attacking player (Optional: false)
    • {any} skill. (Optional: true)
  • Return: object
  • Usage:

Apply damage. Player will lose HP. the attackerPlayer parameter is the other player, the one who attacks.

If you don't set the skill parameter, it will be a physical attack. The attack formula is already defined but you can customize it in the server options

ts
player.applyDamage(attackerPlayer) // returns { damage: number }