Cuberite Forum
Help to Player:ScheduleMoveToWorld - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html)
+--- Thread: Help to Player:ScheduleMoveToWorld (/thread-2947.html)



Help to Player:ScheduleMoveToWorld - moiko89 - 05-17-2017

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(SpawnXSpawnYSpawnZ)
 
   Player:ScheduleMoveToWorld(destWorld,spawnpos3d,false



RE: Help to Player:ScheduleMoveToWorld - xoft - 05-17-2017

You shouldn't use ScheduleMoveToWorld() for same-world teleport, use SetPosition() instead.


RE: Help to Player:ScheduleMoveToWorld - moiko89 - 05-18-2017

(05-17-2017, 07:58 AM)xoft Wrote: You shouldn't use ScheduleMoveToWorld() for same-world teleport, use SetPosition() instead.

It works, thanks!