I have made this script that on a click of a surface GUI the player will be teleported to a game. This is a regular script inside of a text button. Whenever I test it in studio on play solo it works. But when I join a server there is no success. When I try it in play solo as a local script it does not work, nor in a regular server. Please help me and thank you in advanced.
print("Works here")
script.Parent.MouseButton1Down:connect(function()
print("Works Here2")
game:service("TeleportService"):Teleport(265123738, game.Players.LocalPlayer)
print ("Made it this far3")
end)

1 comment
the surfacegui has to be a descendent of the playergui in order for it to be interacted by that player.