So I have a button on a washing machine and I was wondering if someone can help me to where once you press start it starts turning the drum. Here is the script. Maybe this will help. I am planning on tying this script that controls how another part acts. Also I was wondering would I need to add a Click detector to the part as well? If so do I also put the script in the Clickdetector? I plan on having FE on so that everyone doesn't know that the washer started.
button.MouseButon1Down:connect (function()
if state == false then
button.Text = 'Washing'
do
local part = workspace.Drum
while wait(.01) do
part.CFrame = part.CFrame * CFrame.Angles(math.rad(9), math.pi, math.rad(180))
end
state = true
end
else
button.Text = 'Start Washer'
state = false
end
end)
Please and Thank you :)

4 comments
What's going wrong with your script?
Well I am wanting to when I press the button, It starts the rotation of the drum and have some text on the button so when you click it , it says washing and if you dont click it, it says Start washer. And none of that is happening
Are there any error messages in the output?
Nope