Damageable is an interface which defines properties, events, and functions for objects which can take damage and die.
Property Name |
Return Type |
Description |
Tags |
hitPoints |
number |
Current amount of hit points. |
Read-Write |
maxHitPoints |
number |
Maximum amount of hit points. |
Read-Write |
Function Name |
Return Type |
Description |
Tags |
ApplyDamage(Damage) |
None |
Damages a Damageable, unless it is invulnerable. If its hit points reach 0 and it is not immortal, it dies. |
Server-Only |
Die([Damage]) |
None |
Kills the Damageable, unless it is immortal. The optional Damage parameter is a way to communicate cause of death. |
Server-Only |
Event Name |
Return Type |
Description |
Tags |
damagedEvent |
Event <Damageable damageable, Damage damage> |
Fired when the Damageable takes damage. |
Server-Only |
diedEvent |
Event <Damageable damageable, Damage damage> |
Fired when the Damageable dies. |
Server-Only |
Dernière mise à jour: September 25, 2021