GetMonsterData: Difference between revisions
Jump to navigation
Jump to search
Document server-owned monsters and interactions |
Complete Lua function catalog |
||
| Line 31: | Line 31: | ||
* Position values use metres and yaw uses degrees. | * Position values use metres and yaw uses degrees. | ||
[[Category:Lua Functions]] | |||
[[Category:Server Functions]] | [[Category:Server Functions]] | ||
[[Category:World Functions]] | [[Category:World Functions]] | ||
[[Category:Monster Functions]] | [[Category:Monster Functions]] | ||
Revision as of 09:52, 15 August 2026
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.