Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I change the position of a part?

I'm unsure on how to fix this code and why it wont work. Can someone hint me in the right direction?

function Click()
	script.Parent.Position=Vector3.FromAxis(17.142,26.116,-263.459)
end

game.Workspace.restraint1.ClickDetector.mouseClick:connect(Click)

1 answer

✓ Accepted answer

Simple change:

local clicker = script.Parent
local part = script.Parent.Parent

clicker.mouseClick:connect(function()
	part.Position = Vector3.new(0,0,0) --change to position you want
end)

make sure this is a script inside click detector and make sure the click detector is in a part.

so the order will be part's children is click detector, click detector children is script

Please accept answer and upvote if helped!

This discussion is preserved as it was. New answers, comments, and votes are closed.