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)
✓ ANSWER ACCEPTED
Why wont click teleport work 10/10 specific title?
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.
