I'm trying to make a gate where if you click the wheel, the part would spin in place while the gate opens. The script below is separate from the script that opens the gate.
--Prototype w = script.Parent.Parent.Wheel_Part debounce = true function turn() if debounce == true then debounce = false for i=1,450 do w.CFrame = CFrame.fromEulerAnglesXYZ(0,0,-.8) wait() end wait(1) for i=1,450 do w.CFrame = CFrame.fromEulerAnglesXYZ(0,0,.8) wait() end debounce = true end end script.Parent.ClickDetector.MouseClick:connect(turn)
Please tab your code correctly.
Anyways, your problem is that you're setting it to 0.8 rotation 450 times, every 30th of a second. You're not adding 0.8 rotation every 30th of a second 450 times. Try this:
w.CFrame = w.CFrame * CFrame.Angles(0, 0, 0.8) --fromEulerAnglesXYZ works too, this is just easier to type.