What am I doing wrong?
#2
You can't sleep in the command handler, it blocks the server from doing anything else. The plugins don't run in preemptive multitasking, they run in cooperated multitasking, which basically means that "while a function is running, the entire server is waiting for it to finish". That's why we have all the hooks and callbacks, they are mostly to support asynchronicity.

As for the specific question, the Player:TeleportToCoords() function only sets a flag, saying "when this player is next considered for physics, teleport them to these coords". But the physics thread is blocked, waiting for your plugin to finish executing, so the new position doesn't get sent.
Reply
Thanks given by: jakibaki


Messages In This Thread
What am I doing wrong? - by jakibaki - 04-29-2014, 12:26 AM
RE: What am I doing wrong? - by xoft - 04-29-2014, 02:07 AM
RE: What am I doing wrong? - by worktycho - 04-29-2014, 02:18 AM
RE: What am I doing wrong? - by jakibaki - 04-29-2014, 02:22 AM
RE: What am I doing wrong? - by xoft - 04-29-2014, 05:40 AM



Users browsing this thread: 2 Guest(s)