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)
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.
Ok is there a click detector in the part because the script should work but there must be a click detector to work
It didnt Work but thanks for trying :D
Hmmm
Ok is there a click detector in the part the script should work but there must be a click detector in the part
If t works please let me know and it accept the answer if it did
Its not a Part its a GUI
Whoops Srry I meant GUI I was helping some earlier with clickin. A part so I got confused but put still put a click detector in the GUI Srry I didn't put that in my answer I figured u already had a click detected so put a click detector in the GUI
Also let me know if t worked:3
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.
This discussion is preserved as it was. New answers, comments, and votes are closed.
4 comments
I'm in mobile rift now but for 1 thing your top line is a connection so move your top line to the very bottom
I'm in mobile rift now but for 1 thing your top line is a connection so move your top line to the very bottom
Ignore the last 2 comments
Super i never heard if my answer worked:3