Set a player's position when they click a GUI

Hey, I am a fairly new scripter so I just need someone to point me in the right direction here. I am making a script where when you click on a Text Button it will set your position to a part in the workspace. Any ideas?

something like

local player = game.Players.LocalPlayer


player.Character:SetPrimaryCFrame( position here


You’d set this inside of a button’s Local script

This will work:
(insert this into a local script that’s in your GuiButton.)

local Players = game:GetService("Players")

local LocalPlayer = Players.LocalPlayer
local Button = script.Parent
local Part = workspace.Part -- Reference your part

	print(LocalPlayer.Name, "has clicked the button.")

Let me try this real quick. It looks like it should work.

It works, thank you very much for the help. Now I can get back to scripting :P.

1 Like