Teleports an online player to the specified coordinates.
| Name | Type | Description |
|---|---|---|
x, y, z | number | World coordinates. |
yaw | number, optional | Rotation (yaw). |
pitch | number, optional | Rotation (pitch). |
Nothing.
command('spawn', function(sender)
if not sender.isPlayer then return true end
local sx, sy, sz = world.spawn()
sender:teleport(sx, sy, sz)
sender:send(color.green .. "Teleported to spawn!")
return true
end)