How can i make a ui teleport the player too a part when its clicked

pretty simple i want a ui to teleport the player to a part

1 Like

Make a button
and add a localscript into the button.

local Player = game.Players.LocalPlayer
local YourPart = -- Your Part Path Here
Player.Character.HumanoidRootPart.CFrame = YourPart.CFrame

not position you should use CFrame btw

You need to use CFrame

Player.Character.HumanoidRootPart.CFrame =

add a local script inside of this Button
Change yourpart to your Part name

game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = game.Workspace.YourPart.CFrame

You forgot

game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame =

no you could just do HRP.CFrame = Part.CFrame

There is no need for it when you could do


oh it’s interesting to know that I didn’t know about it (even if when you think about it it’s logical)

Use PivotTo() on the Character model to move the Player instead.

it doesnt seem to work

Change YourPart to your part in workspace.

i did it still doesnt work

Can I see your script?

did you try my script?
Chars Limit

yes i tried yours i also doesnt work

make sure its a localscript + inside a GUI Button.

hmm i was trying to fix it but heres my script

game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = game.Workspace.SpawnPart.CFrame

yes its a local script its inside an imagebutton

is it showing an errors in the output?