This script only seems to work in play solo, and I don't know why. This LocalScript is inside of a textbutton in a ScreenGui.
local TeleportService = game:GetService("TeleportService")
local id = 364386074
function onClicked()
print('teleporting player')
TeleportService:Teleport(id)
end
script.Parent.MouseButton1Click:connect(onClicked)

4 comments
Make sure the LocalScript is in a place where LocalScripts run, see http://wiki.roblox.com/index.php?title=API:Class/LocalScript
well, since this is a screengui, this is already in StarterGui.
Try defining the player you want to teleport lol.
What's your output?