I am wanting to associate a part that is for a washer that when you press it it starts rotating a drum. However I am not finding any solutions to it at all. Here is the script I have as of now- first is on the button for the washer (the button is not in GUI terms ~)
local state = false
local part = game.Workspace.Drum
button.MouseButton1Down: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
else
button.Text = 'Start Washer'
state = false
end
end)
I am also wanting to know if there is a formula or function or anything that will help me time the rotation.
Please and Thank you :)
