Okay i have a Main Menu Gui.. In it, it has 4 text buttons, only 3 teleport the player. I want the buttons to teleport players to one of my universes or places within my game once they click the textbutton. But this is what happens, In studio when i try to test the button it says Teleporting players in roblox studio is not permitted. So im saying yay i guess it works... No, When i try to play my game from the website it doesn't teleport people at all.
---------------------- HERES THE SCRIPT -------------------------------- plr = script.Parent.Parent.Parent.Parent
script.Parent.MouseButton1Click:connect(function() game:GetService('TeleportService'):Teleport(143510844,plr) end)
People where telling me i need to specify who needs to get teleported. How do i do that? :/ Please help``
Make the script a localscript. Do not attempt to teleport the character, since that'll result in an error:
wait() local plr = game.Players.LocalPlayer -- MouseButton1Click is for clickdetectors, not textbuttons script.Parent.MouseButton1Down:connect(function() game:GetService('TeleportService'):Teleport(143510844,plr) end) --[[ The error that says "Teleporting players in roblox studio is not permitted." means you can't teleport to other places in studio.]]
Change the script into a LocalScript then put this into it.
plr = game.Players.LocalPlayer.Character script.Parent.MouseButton1Click:connect(function() game:GetService('TeleportService'):Teleport(143510844, plr) end)