function OnClick() game:GetService("TeleportService"):Teleport(259945232,game.Players.LocalPlayer) end script.Parent.ClickDetector.MouseClick:connect(OnClick)
I have gotten no errors and it only works in test mode on a NORMAL script, not a Local.
While using the Teleport
function in a LocalScript, you don't need to supply the player.
function OnClick() game:GetService("TeleportService"):Teleport(259945232) end script.Parent.ClickDetector.MouseClick:connect(OnClick)