Simply said my current script looks something like this
local rolling = true
local parent = script.Parent
local function on()
rolling = false
end
local function off()
washing = true
end
if washing == true then
parent.Parent.Roller.CFrame = parent.Parent.Roller.CFrame * CFrame.fromEulerAnglesXYZ(.4,0,0)
wait()
else
parent.Parent.Roller.CFrame = parent.Parent.Roller.CFrame * CFrame.fromEulerAnglesXYZ(0,0,0)
end
local function Click()
if washing == true then off() else on() end
end
parent.ClickDetector.MouseClick:connect(Click)
still it doesn't works... I don't usually script, mostly building but wanted to make some functional buildings so need to face my weakness now. someone help :p

4 comments
There are multiple issues here. We never defined washing, with both the on and off functions you never change your variables back to the opposite state so they'll always be stuck in either true or false, respectively. You need to wrap your if statement in a while loop. You have meaningless spaces and poor indentation, a deprecated Connect. Your Click() function does nothing.
Try and implement my answer, then when you unavoidably run into issues PLEASE ask for help again in the comments so we can get those fixed. But make sure all pertinent information is given.
So there is a model which contains two parts: button and roller. Script is located in button alongside with click detector. I changed the script a lot so it got messed up a lot. Forget all the washing parts and replace them with rolling. I actually got cleared up in most of stuff, the biggest question I have now is if there is something equal of "else" used along the while loop.
Example: while rolling == true do (insert rotation part) else (this is what I mean) (insert no rotation stuff) end... this kinda looks dumb, but I hope you get the meaning. Thanks for responding and sorry for late reply ^-^