I'm trying to get this block to move whenever you click it. And I haven't been scripting in forever so I've gotten rusty. How exactly would I fix this, or at least get a block to move when you click it?
Fyi, this brick is in a model called Bathroom. And the brick is called PartOfSink if you wanted/needed to know.
local sink = function Button() game.Workspace.Bathroom.PartOfSink.Value = game.Workspace.Bathroom.PartOfSink.Position + game.Workspace.Bathroom.PartOfSink.Position.New(0,0,4) local function SinkWater() end end script.Parent.MouseClick:connect(Button)
Ignore the second function inside that function, it isn't important.
Line 3 has the error. What is "Value"? Do you mean CFrame or Position? Also, you would use Vector3.new, not Position.new.
Check this out:
--Line 3 game.Workspace.Bathroom.PartOfSink.CFrame = game.Workspace.Bathroom.PartOfSink.CFrame * CFrame.new(0,0,4)
Also, just check to make sure that script.Parent
is a ClickDetector.
:)