alright so. i'm trying to make a teleport gui for my game. i whipped up what i thought would work, using examples from the wiki, but it doesn't seem to work. it's a local script.
target = CFrame.new(-420, 94, 531) function parentPressed() game.Workspace.Player.HumanoidRootPart.CFrame = target end script.Parent.MouseButton1Down:connect(parentPressed)
here it is. thank you in advance!
Here try this: Put this script into the GUI button to teleport the player!
local plr = game.Players.LocalPlayer script.Parent.MouseButton1Click:connect(function() plr.Character:MoveTo(Vector3.new(-420, 94, 531)) --Change the coordinates to location you want to move the player to. end)
Any questions feel free to ask. If it works the please accept my answer.