Here is my code, It's on a surfaceGUI and teleports the player to another game, Works fine in Test mode as stated.
button = script.Parent button.MouseButton1Down:connect(function () plrgui = button.Parent.Parent player = plrgui.Parent id = '411830270' game:GetService('TeleportService'):Teleport(id, player) end)