GetMonsterData

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

getMonsterData

Returns the complete authoritative state of a server-owned monster.

Syntax

table|false getMonsterData(string monsterId)

Parameters

Name Type Required Description
monsterId string yes The opaque decimal monster identifier returned by spawnMonster or getMonsters.

Returns

Returns a table containing id, type, position, yaw, health, maximum health, state, target player, aggression, and alive state; otherwise returns false.

Examples

Inspect a monster:

local monster = getMonsterData(monsterId)
if monster then
    outputDebugString(monster.type .. " HP: " .. monster.health .. "/" .. monster.maxHealth)
end

Notes

  • Available only in server-side resource scripts.
  • Position values use metres and yaw uses degrees.