Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

TeleportService is not working?

Hello! I have a game with a place connected to it. I put a part in the Game (or start place) that is supposed to teleport any player that touches it to the place. The problem is, it doesn't work. Anytime a player touches the teleport brick, their screen freezes, and then their game crashes.

I'm pretty sure this has nothing to do with the script, but I'm having a really tough time trying to figure out why this is happening. Any help would be greatly appreciated!!!!

Edit: I checked the dev console in game and it says, "raiseTeleportInitFailedEvent: Teleport Failed because The previous teleport is in processing (IsTeleporting)" I don't know what it means or how to fix it.

local TeleportService = game:GetService("TeleportService")
local gameID = 123456789 --I didnt want to expose actual place id
 
function onTouched(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
        TeleportService:Teleport(gameID, player)
    end
end
 
script.Parent.Touched:connect(onTouched)

2 comments

0

What is the error message?

0

i dont have time to check because it just freezes and crashes

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.