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

Help with local lighting. Doesn't work visually?

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

✓ Accepted answer

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.

3 comments

0

Didn't work, when it goes up, it goes up in the script, but not in the place where it shows the value.

0

Edited my answer.

0

Worked perfectly, thank you!

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