My script doesn't seem to work properly.
brick = script.Parent.brick c = true function OnC() if c == true then c = false brick.CFrame = CFrame.new(-39.2, 4.69, -53.3) else brick.CFrame = CFrame.new(-39.2, 4.69, -46.8) c = false end end brick.ClickDetector.MouseClick:connect(OnC)
When I click my door, it rotates 90 degrees. When I click it again, it goes back. When I attempt to click one last time, it does not do anything. The script breaks after that.
I see one error that I think is wrong. Since 'c' is acting as a debounce at the end you forgot to change it back to true. So line 10 should be like this:
c = true
brick = script.Parent.brick c = true b = 0 function OnC() if c == true then brick.CFrame = CFrame.new(-39.2, 4.69, -53.3) b = 1 c = false end if b == 1 then brick.CFrame = CFrame.new(-39.2, 4.69, -46.8) c = true b = 0 end end brick.ClickDetector.MouseClick:connect(OnC)