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

Moving Brick Button [Help Needed]?

Asked by 9 years ago

Basically I just need help on the part of the code where the block will return I have it set to wait 2 seconds then it will move back by it's self, but I want it to move back once I click the button again. Could I get some help please? Thanks!

01d = false
02function onClicked()
03    if d == false then
04        d = true
05 
06        print("Moving Brick To Right")
07        script.Parent.Parent.DoorButton.BrickColor = BrickColor.new("Really red")
08        for i = 1,49 do
09        script.Parent.Parent.Door.CFrame = script.Parent.Parent.Door.CFrame * CFrame.new(0, 0, 0.244) * CFrame.fromEulerAnglesXYZ(0,0,0)
10        wait()
11        end
12 
13        -- I need this section to move after I click the brick once again but I can't figure it out
14        wait(2)
15        script.Parent.Parent.DoorButton.BrickColor = BrickColor.new("Lime green")
View all 24 lines...

Answer this question