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

0

Make sure the LocalScript is in a place where LocalScripts run, see http://wiki.roblox.com/index.php?title=API:Class/LocalScript

0

well, since this is a screengui, this is already in StarterGui.

0

Try defining the player you want to teleport lol.

0

What's your output?