The SurfaceGui is located in a Part of a Group, and inside the SurfaceGui is a TextButton that has a LocalScript. The LocalScript is supposed to teleport the player clicking the TextButton to a specified location, but I don't know how to make the LocalScript do that in my code .
local p = game.Players.LocalPlayer local body = p.Character.HumanoidRootPart --HumanoidRootPart is used to make the game compatible with R15 function onClicked(GUI) body.CFrame = CFrame.new(Vector3.new( -281, 60.2, 238 )) end script.Parent.MouseButton1Click:connect(onClicked)
move the SurfaceGui to StarterGui and change the Localscript to this V
local p = game.Players.LocalPlayer local player = game.Players:FindFirstChild(p.Name) script.Parent.Parent.Parent.Adornee = game.Workspace(CHANGE THIS) local body = p.Character.HumanoidRootPart --HumanoidRootPart is used to make the game compatible with R15 script.Parent.MouseButton1Click:connect(function() body.CFrame = CFrame.new(Vector3.new( -281, 60.2, 238 )) end)
line 3 will make it visible on the part when they join and it will get the name of the player since the surfacegui is in their playerGui, it's easily to find their name
dont forget to change the part on Line 3