Problem changing the Ambient according to the time of day

You need to do to it in the other order, because all the other values are bigger that the first, so it’s always passing the first.

Start with the biggest one, elseif the next one, etc

1 Like

It works thank you for spending time helping me !!!

the script:

  while true do 
	wait()
	minute = game.Lighting:GetMinutesAfterMidnight()	

   if minute >= 1110 then
		game.Lighting.Ambient = Color3.fromRGB (38,38,38)
		game.Lighting.OutdoorAmbient = Color3.fromRGB(44,44,44) 
		
   elseif minute >= 1080 then
		game.Lighting.Ambient = Color3.fromRGB (70,70,70)
		game.Lighting.OutdoorAmbient = Color3.fromRGB(84,84,84)
		
     elseif minute >= 1020 then
	    game.Lighting.Ambient = Color3.fromRGB (106,106,106)
	    game.Lighting.OutdoorAmbient = Color3.fromRGB(138,138,138)
		
	
     elseif minute >= 600  then
		game.Lighting.Ambient = Color3.fromRGB (150,150,150)
		game.Lighting.OutdoorAmbient = Color3.fromRGB(200,200,200) 
		
     elseif minute >= 420 then
		game.Lighting.Ambient = Color3.fromRGB (106,106,106)
		game.Lighting.OutdoorAmbient = Color3.fromRGB(138,138,138) 
	
	elseif minute >= 360 then
		game.Lighting.Ambient = Color3.fromRGB (70,70,70)
		game.Lighting.OutdoorAmbient = Color3.fromRGB(84,84,84) 
	

end
end
1 Like