when i play leaves during a teleport. i want that teleport to cancel and not go through. because it will cause an error in the place they’re teleporting too.
is there anyway to cancel a teleport?
when i play leaves during a teleport. i want that teleport to cancel and not go through. because it will cause an error in the place they’re teleporting too.
is there anyway to cancel a teleport?
Personally I haven’t used teleport service, but I am sure you can check the players teleport and check if they still exist when they join. If they do then carry on, else if they haven’t then do that. I would recommend having 10-15 seconds for everyone to join, since they could just be really slow.
As for cancelling I don’t know, I read about teleport service but I couldn’t find anything related to cancelling a teleport. I am sure if I am wrong someone will let me know.
I read through TeleportService’s all functions, but I didn’t found anything. Maybe TeleportInitFailed would help you, but I am not sure about that.
TeleportInitFailed is an event, meaning you can connect it a function. It happens when a teleport fails. I looked through the functions of TeleportService and it looks like you can’t really cancel a teleport. I would do a bit more research, though.
i think you could disable the script but i’m not sure if it’ll work.
Use the TeleportCancel
Function of the service.
I just want to assure that this WON’T work simply because the actual teleport is being handled by another script, and not the script that has called the teleport. I wouldn’t suggest trying to disable THAT script because it’s, well, a service, and could cause a load of errors, and I’m pretty sure they’re all module scripts anyways.
Try to Cantouch = false. And its disabling teleport
If you are asking about the game not teleporting the other players if one player left during the teleport then i guess you can use pcall