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

How do I use negatives in scripting?

How do I use negative numbers in Scripting? I am playing with the new lighting effects and trying to make the screen go from black to normal, but If I put a - in front of the number nothing happens. So far I had:

local Correction = game.Lighting.ColorCorrection
Correction.Brightness = -1
wait(.2)
Correction.Brightness = -.95
wait(.2)

and so on skipping by 5's down to 0. But, nothing happens. Please advise.

1 answer

✓ Accepted answer

That would work for every other math equation, except for values that cannot fall below 0, such as Transparency, Color3, or brightness. Try going from 0 to 1?

Also, instead of putting a script in for every entry, just use a for do bit:

local Correction = game.Lighting.ColorCorrection
for i = 0,1,0.05 do
wait(.2)
Correction.Brightness = i
end

Hope that helped! :)

2 comments

0

Either the "i" in "for I" has to lower case, or the "i" in "Brightness = i" has to be uppercase.

0

Yep.

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