I need help with this teleport script.
script.Parent.MouseButton1Click:connect(function(hit) local player = hit.Parent if player then game:GetService("TeleportService"):Teleport(player, 254676560) end end)
Hi I'm on mobile so if it confusing I'm Srry can't really type in the code block good on mobile I also can't test it but it should work.
script.Parent.ClickDetector.MouseClick:connect(function(player) --You want to have the script identify the player here. wait(4) --this gives us a wait before we continue if player then -- calling from the function above game:GetService("TeleportService"):Teleport(165643174, player) -- this teleports the player end end)
Hope this helped let me know if it did.
It didnt Work but thanks for trying :D
function onButtonClicked() local player = game.Players.LocalPlayer if player then game:GetService("TeleportService"):Teleport(254676560, player) end end
script.Parent.MouseButton1Click:connect(onButtonClicked)
Make sure this is in a local script not a script. LocalScripts is different from regular Scripts as they do not run server-side, but instead, perform their actions on the client.