Here is my code, It's on a surfaceGUI and teleports the player to another game, Works fine in Test mode as stated.
1 | button = script.Parent |
2 | button.MouseButton 1 Down:connect( function () |
3 | plrgui = button.Parent.Parent |
4 | player = plrgui.Parent |
5 | id = '411830270' |
6 | game:GetService( 'TeleportService' ):Teleport(id, player) |
7 | end ) |