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

How do I get this Block to move?

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.

1 comment

0

Is script.Parent a Click Detector?

1 answer

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.

:)

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