button = script.Parent -- the button
button.MouseButton1Down:connect(function ()
plrgui = button.Parent.Parent
player = plrgui.Parent
id = 'ID'
game:GetService('TeleportService'):Teleport(id, player) --
end)
it works in studio but not the game help?

3 comments
normal
Try a local?
yep it worked