Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help me with this teleport script error?

Asked by 8 years ago

I got this script from http://wiki.roblox.com/index.php?title=TeleportService_guide#Example_Code

This one teleport to the same server as the player you are joining

function onTouched(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
        local succeeded, errorMsg, placeId, instanceId = game:GetService("TeleportService"):GetPlayerPlaceInstanceAsync(game.ReplicatedStorage.ID.Value)
        if succeeded then
            game:getService("TeleportService"):TeleportToPlaceInstance(placeId, instanceId, player)

        end
    end
end

script.Parent.Touched:connect(onTouched)

script error http://prntscr.com/9vzsnl

2
Perhaps the error is you're trying to teleport to a place not in your current game? The error output seems to imply that. iconmaster 301 — 8y

Answer this question