GetMonsterHealth
Jump to navigation
Jump to search
getMonsterHealth
Returns a monster's authoritative current and maximum health.
Syntax
number currentHealth, number maximumHealth getMonsterHealth(string monsterId)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
monsterId |
string |
yes | The opaque decimal monster identifier returned by spawnMonster or getMonsters.
|
Returns
Returns current health and maximum health. Invalid identifiers return 0, 0.
Examples
Read monster health:
local health, maximum = getMonsterHealth(monsterId)
outputDebugString(health .. "/" .. maximum)
Notes
- Available only in server-side resource scripts.