GetMonsterPosition: Difference between revisions
Jump to navigation
Jump to search
Document server-owned monsters and interactions |
Complete Lua function catalog |
||
| Line 31: | Line 31: | ||
* Coordinates use metres and yaw uses degrees. | * Coordinates 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]] | ||
Latest revision as of 09:52, 15 August 2026
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.