This script is like any Day and Night script, except I made a few changes to it to shift effects when a certain time hits. The problem I currently face is when the time hits Night and the effects shift, when the time hits Day it won't change back.. I tried everything.. A new script, changing the time for it to shift, and debugging. Nothing worked. Anyone know fixes?
The problem part is where the script says elseif lighting.TimeOfDay == "06:00:00"
Script in question:
--//[Day & Night]
--// Variables
local lighting = game:GetService("Lighting")
local blurring = lighting:WaitForChild("Blurring")
local correct = lighting:WaitForChild("Correct")
--// Functions
while true do
lighting:SetMinutesAfterMidnight(lighting:GetMinutesAfterMidnight() + 0.2)
if lighting.TimeOfDay == "20:00:00" then
print("Changing") -- Was used for debugging purposes.
spawn(function()
for i = 1,70 do
blurring.Size = blurring.Size + 0.1
correct.Saturation = correct.Saturation - 0.01
wait()
end
end)
elseif lighting.TimeOfDay == "06:00:00" then
print("Changing") -- Was used for debugging purposes.
spawn(function()
for i = 1,70 do
blurring.Size = blurring.Size - 0.1
correct.Saturation = correct.Saturation + 0.01
wait()
end
end)
end
wait()
end
Edit: I have figured out how to make it do what I wanted. Thank you for attempting to help me everyone!
