I've been trying to figure this out forever. I assumed this process would be really similar to a screenGUI but it never seems to work out. The closest I can get this to work is in PlaySolo.
I have this ServerScript inside of an image button of the surfaceGUI:
local service = game:GetService("TeleportService") local id = 186379525 local plr = game.Players.LocalPlayer script.Parent.MouseButton1Click:connect(function() wait(1) service:Teleport(id, plr) end)
I used this script in a different game I made with a screenGUI, but it was a LocalScript instead of a ServerSript.
Try Reading This : http://wiki.roblox.com/index.php?title=TeleportService_guide
Its All About TeleportService.
Or Read This If You Want To Know How To Teleport Within Places. http://wiki.roblox.com/index.php?title=Teleportation