Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I get this Block to move?

Asked by
tanzane 100
10 years ago

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.

0
Is script.Parent a Click Detector? NotsoPenguin 705 — 10y

1 answer

Log in to vote
0
Answered by
Discern 1007 Moderation Voter
10 years ago

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.

:)

Ad

Answer this question