GetMonsterState

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 09:52, 15 August 2026 by QCherry (talk | contribs) (Complete Lua function catalog)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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 isMonsterAlive for life-state decisions.