Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

My script is meant to break when Saturation reaches -1, but it is not?

The script is meant to lower the Saturation to -1, then when it hits -1 it is meant to stop. However, it continues to lower the saturation, and does not stop.

How can I make it stop at -1?

local C = game.Lighting.ColorCorrection

script.Parent.DiseaseValues.Cure1.Colourblind.Value = false
script.Parent.DiseaseValues.DiseaseTotal.Counter.Value = 1

i = 0.5
while true do
    i = i - 0.1
    wait(1)
    C.Saturation = i
    if i == -1 then
        break
    end
end

2 comments

0

Since you know it should stop at -1 why not just use a numerical loop?

0

Obviously had a dumb moment. I switched it to a for loop.

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.