GetMonsterPosition
getMonsterPosition
Returns the authoritative position and yaw of a server-owned monster.
Syntax
table|false getMonsterPosition(string monsterId)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
monsterId |
string |
yes | The opaque decimal monster identifier returned by spawnMonster or getMonsters.
|
Returns
Returns a table with x, y, z, and yaw fields and matching numeric indices, or false.
Examples
Read a monster position:
local position = getMonsterPosition(monsterId)
if position then
outputDebugString(position.x .. ", " .. position.y)
end
Notes
- Available only in server-side resource scripts.
- Coordinates use metres and yaw uses degrees.