Hello guys. I have a script that "stops" working after decreasing to the intended value (0 "zero"), but it doesn't stop working after reaching it.
Here's the repeat loop:
local x = 8.5
repeat wait(0.2)
script.Parent.CFrame = script.Parent.CFrame * CFrame.Angles(x,0,0)
x -= 0.1
until x == 0
script.Disabled=true
I think my problem starts after the "until" because it doesn't stop after reaching the intended value. I tried putting that, didn't work, as usual...
until x == 0
script.Disabled=true
What should I type instead to make it work?

5 comments
I don't know what's wrong, but I wouldn't suggest using repeat until loops. Use a for loop or a while loop instead. No one likes reapeat until loops.
I'm not sure if the "repeat until" is the source of my problem but, I rewrote the script and it works now (you can look at to my answer if you wanna learn the script that works)
Repeat loops are your own choice, it works, but you need to define a variable. For loops does not need a variable and it returns the same thing "No one likes repeat until loops" is not correct since repeat loops are way easier for beginners
I agree. Both of these loops have pretty similar logic and they're almost the same, but as you said unlike "while" loops you should define a variable to make it work.
Repeats loop and while loops are the same thing, but I'd recommend repeat loop since it's more consistent and make your script looks better lol