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

How do I use negatives in scripting?

Asked by 8 years ago

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

Log in to vote
0
Answered by
Aespect 25
8 years ago

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! :)

0
Either the "i" in "for I" has to lower case, or the "i" in "Brightness = i" has to be uppercase. SimplyRekt 413 — 8y
0
Yep. Aespect 25 — 8y
Ad

Answer this question