GetMonsterState
getMonsterState
Returns a monster's current server-owned AI/action state.
Syntax
string getMonsterState(string monsterId)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
monsterId |
string |
yes | The opaque decimal monster identifier returned by spawnMonster or getMonsters.
|
Returns
Returns the current state string, or missing for an invalid identifier.
Examples
Check whether a monster is dead:
if getMonsterState(monsterId) == "dead" then
outputDebugString("Monster defeated")
end
Notes
- Available only in server-side resource scripts.
- State names are presentation-friendly observations; scripts should use
isMonsterAlivefor life-state decisions.