So i built a teleport script which is in a localscript which is in a GUI at the moment. However to takes forever to be teleported. My console gives me "bad request" errors and they never end until I am teleported. As well as the fact that sometimes the game I want to be teleported to crashed. I wanted to know if there was a better way or more stable way to use this teleport script. I sat once for 3 minutes till the script finally teleported me. Exuse my lack of teleporting players to different games knowledge I just started this.
player = game.Players.LocalPlayer
script.Parent.MouseButton1Down:connect(function()
game:GetService("TeleportService"):Teleport(334747890, player)
end)

3 comments
The script should not be having to look for LocalPlayer, it's a property for Players that gets set for each client. I do not see why the user's script was not working, however you should not have to use multiple parents just to find the player in a local script.
Sorry for doing it the way I was taught..
You were poorly taught. Teaching other people hacky and horrid ways rather than making a suitable solution is wrong. The only way I think of possibly fixing it is adding a "local" before the variable to push it to the top of the stack.