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

Help with local lighting. Doesn't work visually?

Asked by 4 years ago

I'm trying to make a script that slowly makes it black and white over time, and it works in a regular server script.

When I try it in a local script, it doesn't work visually. The script works, as I added a print and it repeats until the saturation is -1.1.

But it just doesn't work visually. I don't understand why. Thanks for taking time to read.

local script placed in StarterPlayerScripts:

print("yes")


wait(4)

local thing = game.Lighting.ColorCorrection.Saturation

    print("no")

    while thing > -1.1 do

        print("yes")

        wait(.25) 

        thing = thing -.01

    end

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Try cloning the ColorCorrection to workspace.CurrentCamera, and instead of workspace.CurrentCamera.ColorCorrection.Saturation, you'd have to do workspace.CurrentCamera.ColorCorrection, and replace thing with thing.Saturation.

Edit: Basically you'd have to do something like this.

local ColorCorrection = Instance.new('ColorCorrectionEffect')
ColorCorrection.Parent = workspace.CurrentCamera

print("yes")

wait(4)

print("no")

while ColorCorrection.Saturation > -1.1 do
    print("yes")
    wait(.25) 
    ColorCorrection.Saturation = ColorCorrection.Saturation -.01
end

That script creates a ColorCorrectionEffect in CurrentCamera and does what you wanted.

0
Didn't work, when it goes up, it goes up in the script, but not in the place where it shows the value. Quantrium 14 — 4y
0
Edited my answer. jaydensar 40 — 4y
0
Worked perfectly, thank you! Quantrium 14 — 4y
Ad

Answer this question