How can I get my ambient script to work correctly?
So, I have a script that changes the Outdoor Ambient depending on the time of day. When it's dark out, the ambient is 0,0,0, at dawn it has a bluish hue, etc.
The following script is almost a year old, from one of my PAs that had a Scripting Helpers account. It worked for me a year ago, IDK why it isn't working now. I changed it from FogColor to OutdoorAmbient, if that means anything.
1 | game.Lighting.Changed:connect( function () |
2 | if game.Lighting.TimeOfDay = = "00:00:00" then |
3 | game.Lighting.OutdoorAmbient = Color 3. new( 0 , 0 , 0 ) |
4 | elseif game.Lighting.TimeOfDay = = "5:00:00" then |
5 | game.Lighting.OutdoorAmbient = Color 3. new( 13 / 255 , 60 / 255 , 131 / 255 ) |
6 | elseif game.Lighting.TimeOfDay = = "7:00:00" then |
7 | game.Lighting.OutdoorAmbient = Color 3. new( 127 / 255 , 127 / 255 , 127 / 255 ) |
The script doesn't work though, and I'm starting my game at midnight, which should have 0,0,0 as an outdoor ambient. When I run the game, it stays at 127,127,127 as normal.
If any of you could tell me what I'm doing wrong, that would be much appreciated. :)