GetPlayerPosition
Jump to navigation
Jump to search
getPlayerPosition
Returns the latest authoritative snapshot position of a player in metres.
Syntax
table getPlayerPosition(int playerId)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player identifier. |
Returns
Returns a table with x, y, z and numeric indices 1..3, or false when unavailable.
Examples
Read a player's position:
local position = getPlayerPosition(playerId)
if position then
print(position.x, position.y, position.z)
end
Notes
- Available only in server-side resource scripts.
- Coordinates returned by this function are in metres, not Unreal units.