I created a button for the game. So you will teleport when the button is pressed, it works in ROBLOX Studio, but it won't work in ONLINE mode. I already know that I used:
local player = game.Player.LocalPlayer
-- I dont know how else to use cause this wont work else:
player = script.Parent.Parent.Parent.Parent
-- or this:
function PlayerClicked(player)
local pos = game.Workspace.Exitpart
player.Character:moveTo(pos.Position)
end
script.Parent.MouseButton1Clicked:connect(PlayerClicked)
-- So my general script that I used is this one:
local player = game.Players.LocalPlayer
local character = player.Character
script.Parent.MouseButton1Click:connect(function()
local pos = game.Workspace.ExitPart
character:moveTo(pos.Position)
script.Parent.Parent.Enabled = false
end)
Sorry if you didn't understanded lua selection of my message content, but it didn't allowed me to add more lua slections cause it glitches the message....
It won't work. if you need more information please send a request in the comments and I will add more info. Please help!

2 comments
is filtering enabled on?
by the way, line 8 can be simplified with: script:FindFirstAncestorOfClass("Player") because im assuming the gui is located in the players service