TeleportPlayer: Difference between revisions
Jump to navigation
Jump to search
Automatyczna aktualizacja dokumentacji funkcji |
Complete Lua function catalog |
||
| Line 37: | Line 37: | ||
* Coordinates use metres and yaw uses degrees. | * Coordinates use metres and yaw uses degrees. | ||
[[Category:Lua Functions]] | |||
[[Category:Server Functions]] | [[Category:Server Functions]] | ||
[[Category:Player Functions]] | [[Category:Player Functions]] | ||
[[Category:Spatial Functions]] | [[Category:Spatial Functions]] | ||
Revision as of 09:55, 15 August 2026
teleportPlayer
Teleports a connected player to an authoritative world position.
Syntax
bool teleportPlayer(int playerId, number x, number y, number z [, number yaw = 0])
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player identifier. |
x |
number |
yes | World X coordinate in metres. |
y |
number |
yes | World Y coordinate in metres. |
z |
number |
yes | World Z coordinate in metres. |
yaw |
number |
no | Optional actor yaw in degrees; defaults to 0. |
Returns
Returns true when the teleport is accepted and queued; otherwise returns false.
Examples
Teleport a player to an RP spawn point:
teleportPlayer(playerId, 125.5, -48.0, 3.25, 180)
Notes
- Available only in server-side resource scripts.
- This is the explicit teleport alias of
setPlayerPositionand emitsonPlayerTeleport. - Coordinates use metres and yaw uses degrees.