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

Why does the FogColor not change?

I'm trying to make a script that changes the FogColor of Lighting when the ClockTime changes, however it produces no errors in the output.

local lighting = game:GetService("Lighting")

lighting.Changed:Connect(function()
	if lighting.ClockTime == 6.4 then
		for i = 1, lighting.FogColor.R do
			lighting.FogColor = lighting.FogColor + Color3.fromRGB(1, 1, 1)
		end
	elseif lighting.ClockTime == 18 then
		for i = 1, lighting.FogColor.R, -1 do
			lighting.FogColor = lighting.FogColor - Color3.fromRGB(1, 1, 1)
		end
	end
end)

Why isn't this working and how can I fix it? Please help!

1 answer

it should work.

if it doesnt work than it is the RGB coloring part or that everytime a lighting property changes the if statement will run again so depending on how long you make each day in the game the fog lighting will only change when clocktime is at 6.4 and 18

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