This is in a serverscript in server script service with FE turned on.

minutesAfterMidnight = 1320000
while wait(.5) do
	minutesAfterMidnight = minutesAfterMidnight + 2
	game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight)
	if game.Lighting.TimeOfDay == "20:00:00" then
		game.Lighting.Brightness = 0
		game.Lighting.Ambient = Color3.new(0,0,0)
		game.Lighting.FogColor = Color3.new(0,0,0)
	elseif game.Lighting.TimeOfDay == "8:00:00" then
		game.Lighting.Brightness = 1
		game.Lighting.Ambient = Color3.new(128/255, 128/255, 128/255) -- This part doesn't change the ambiency
		game.Lighting.FogColor = Color3.new(128/255, 128/255, 128/255)
	end
end

2 comments

0

I would say, use a LocalScript.

1

No. The problem is most liekly that the TimeOfDay will never equal exactly 20:00:00 or 8:00:000. You should check within a range to be safe. Another reason might be that you aren't noticing the Ambience change, try changing the OurdoorAmbient property.