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)

3 comments
i dont think you can do it with HumanoidRootPart, i tried it in studio, the camera is moving and my character is doing the walking animation
script i used: game.Workspace.Player1.HumanoidRootPart.Position = Vector3.new(0,0,0,0)
oh my bad it does work with CFrame: game.Workspace.Player1.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(0,0,0,0))