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 :)
local state = false local part = game.Workspace.Drum button.MouseButon1Down:connect (function() if state == false then state = true button.Text = 'Washing' while wait(.01) do part.CFrame = part.CFrame * CFrame.Angles(math.rad(9), math.pi, math.rad(180)) end end else button.Text = 'Start Washer' state = false end end)