Cuberite Forum

Full Version: Help to Player:ScheduleMoveToWorld
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
if i use the follow code i spawn on  Worldspawn or Bed,
but i want to spawn an the coords from vector3d. I called this function with HOOK_PLAYER_SPAWNED


PHP Code:
   local SpawnX = 0    local SpawnY = 64    local SpawnZ = 0    local destWorld =Player:GetWorld()    local spawnpos3d = Vector3d(SpawnX, SpawnY, SpawnZ)    Player:ScheduleMoveToWorld(destWorld,spawnpos3d,false)
You shouldn't use ScheduleMoveToWorld() for same-world teleport, use SetPosition() instead.
(05-17-2017, 07:58 AM)xoft Wrote: [ -> ]You shouldn't use ScheduleMoveToWorld() for same-world teleport, use SetPosition() instead.

It works, thanks!