Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How does one loop a repeat... until statement forever without making the script ignore the until?

Asked by 5 years ago
Edited 5 years ago

Hey guys, so I've been trying to write a script that slowly fades fog in and out. It already works pretty well, I also made a script that makes a day/night cycle. The fog creeps in at 4 am and creeps out at 9. Except it only works once. After a "roblox day" it stops working. That's why I need help. When I loop the "repeat" loop, the "until" gets ignored and the values of the fog keep subtracting up for infinity when it should stop at the values I set.

This is the function that starts the fog. Hope someone can help.

function nevoeirostart()
repeat
wait(0.1)
if game.Lighting:GetMinutesAfterMidnight() > 4 * 60 then
game.Lighting.FogStart = game.Lighting.FogStart - incremento2
end
if game.Lighting:GetMinutesAfterMidnight() > 4 * 60 then
game.Lighting.FogEnd = game.Lighting.FogEnd - incremento1
end
until game.Lighting.FogStart < 50 and game.Lighting.FogEnd < 450
end

wait(0.1)

nevoeirostart()
0
Why can't you just run a for i = x, y loop? cmgtotalyawesome 1418 — 5y
0
If i'm not wrong it's gonna stop once it meets those conditions. use a while true do loop vissequ 105 — 5y
0
use while true do greatneil80 2647 — 5y
0
I did use a while true loop but as I said then the until gets ignored. I want the fog to decrease until a certain value and then stop and repeat the next time JohnyCruz 14 — 5y
0
uSe HEarTbeAT! hellmatic 1523 — 5y

Answer this question