I'm trying to make a button that when player click it, get teleported to another server here's the script:
script.Parent.MouseButton1Click:connect(function() game:GetService("TeleportService"):Teleport("EnterGameIDHere") end)
It not worked
This question is very non-descriptive, the script you posted has to be in a LocalScript parented to the TextButton, you also obviously have to change the game ID, teleportation is also pretty slow and can take up to 15 seconds to work properly, I also doubt this would work in studio's test mode for obvious reasons, do some print debugging and test it in actual game.
Closed as Non-Descriptive by Ashley_Phantom, Leamir, SuperSamyGamer, and Arkrei
This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.
Why was this question closed?