✓ Accepted answer
Ask yourself this question:
How many times do you want the loop to run?
Lets say you want it to run 10 times, you could do this:
local head = script.Parent.Head
for i = 1, 10 do
wait()
head.CFrame = head.CFrame * CFrame.Angles(0, -.05, 0)
end
From what I understand, you want it to rotate at a constant rate. In your example, the amount it rotates changes each time you loop through.
Note that CFrame.Angles uses radians, if you were using degrees and don't know the radian conversion, simply use math.rad(number).
local head = script.Parent.Head
for i = 1, 10 do
wait()
head.CFrame = head.CFrame * CFrame.Angles(0, math.rad(-.05), 0)
end
2 comments
Why not just add the number.... subtracting a negative is the same as adding?
how would you do that?