Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[Help Needed] I am making a day/night script to make it darker at night. Help?

Asked by 4 years ago

**So basically I am trying to make a day/night script that makes the night darker but from what i made it works as soon it becomes night but when it becomes day again it doesn't want to go back to normal it just stays dark. Here's my code

while wait(0.3)do
    game.Lighting:SetMinutesAfterMidnight(game.Lighting:GetMinutesAfterMidnight()+1)
    if game.Lighting.TimeOfDay == "18:00:00" then
        game.Lighting.Brightness = 0.25
        game.Lighting.Ambient = Color3.new(50,50,50)
        game.Lighting.OutdoorAmbient = Color3.new(50,50,50)
    end   
    if game.Lighting.TimeOfDay == "06:00:00" then
        game.Lighting.Brightness = 2
        game.Lighting.Ambient = Color3.new(188,188,188)
        game.Lighting.OutdoorAmbient = Color3.new(195,195,195)
    end
end

So may I ask any of you to help me fix it please!

Answer this question