GetMonsterState: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Document server-owned monsters and interactions
 
Complete Lua function catalog
 
Line 30: Line 30:
* State names are presentation-friendly observations; scripts should use <code>isMonsterAlive</code> for life-state decisions.
* State names are presentation-friendly observations; scripts should use <code>isMonsterAlive</code> for life-state decisions.


[[Category:Lua Functions]]
[[Category:Server Functions]]
[[Category:Server Functions]]
[[Category:World Functions]]
[[Category:World Functions]]
[[Category:Monster Functions]]
[[Category:Monster Functions]]

Latest revision as of 09:52, 15 August 2026

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.