Im new in scripting and I run into this problem while coding a day and night cycle
-
What do you want to achieve?
I want to change some lighting properties in each time of a day -
What is the issue? The lighting properties wont change but the day and night cycle still run normally
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub? Yes I have but none of it seems to reach my satisfaction.
local lighting = game:GetService("Lighting")
local minutes = 8 * 60
local blur = game.Lighting.Blur
while wait() do
lighting:SetMinutesAfterMidnight(minutes)
minutes = lighting:GetMinutesAfterMidnight()
if minutes > 18 * 60 then
minutes = minutes + 0.033333333333333333333
blur = 100
elseif minutes > 6 * 60 then
minutes = minutes + 0.033333333333333333333
elseif minutes > 17.8 * 60 then
minutes = minutes + 0.02
blur = 10
end
end
My code is here, looks really simple because Im new in scripting.
Take an example that I want to make the night a bit blur after 18 pm and I code in those blur lines up there
local blur = game.Lighting.Blur
blur = 100
but it wont run and also
elseif minutes > 17.8 * 60 then
minutes = minutes + 0.02
blur = 10
this small line of codes I want to make it the sunset but it didnt run
Can anyone help me solve these problems, I will be much appreciated! and does putting tween service in a day and night cycle script a good idea?