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

Why wont click teleport work 10/10 specific title?

function onClicked(Player)
    local player = game.Players:GetPlayerFromCharacter(Player.Parent)
    if player then
        game:GetService("TeleportService"):Teleport(4835460592, player)
    end
end
 
script.Parent.ClickDetector.MouseClick:connect(onClicked)

1 answer

✓ Accepted answer
function onClicked(Player)
local placeId = 0 -- replace this to your game id
local userId = 1 -- replace with player's userId
   local player = Players:GetPlayerByUserId(userId)
    if player then
        game:GetService("TeleportService"):Teleport(placeId, userId)
    end
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

Also use :Connect because :connect is outdated.

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