I have tried over and over again but failed constantly, I need help with this.. The text after this message is my code
local MinutesAfterMidnight = 0
while true do
game.Lighting:SetMinutesAfterMidnight(MinutesAfterMidnight) MinutesAfterMidnight = MinutesAfterMidnight + 1 wait (0.01) if MinutesAfterMidnight >= 6 * 60 and MinutesAfterMidnight <= 18 * 60 then game.Lighting.Brightness = (1) game.Lighting.OutdoorAmbient.r = (0/255) game.Lighting.OutdoorAmbient.g = (0/255) game.Lighting.OutdoorAmbient.b = (0/255) end if MinutesAfterMidnight >= 18 * 60 and MinutesAfterMidnight <= 6 * 60 then game.Lighting.Brightness = (0) game.Lighting.OutdoorAmbient.r = (135/255) game.Lighting.OutdoorAmbient.g = (135/255) game.Lighting.OutdoorAmbient.b = (128/255) end
end
Additional to kingdom5's comment: a value can't be bigger than 18x60 and lower than 6x60(Describing the second if condition) so use or
instead of and
for it and it will take care of your script.
Note: and
in first if condition
is fine, don't change it.