My Day/ Night Cycle Script isn't working

I am trying to figure out how I can fix my day/ Night Cycle Script

Script that I used:

I have tried to fix this multiple times it hasn’t worked

Can someone help?

1 Like

You can just use a while loop to increment the time

why u don’t make this instead

while true do
   wait()
   game.Lighting.ClockTime = game.Lighting.ClockTime + 0.001
end
1 Like

Ok I’ll test it to see if that works

Seems complicated.

local Lighting = game:GetService'Lighting';

while true do
Lighting:SetMinutesAfterMidnight(Lighting:GetMinutesAfterMidnight()+(wait()*1.1));
end

I think I know why it’s not working I think its because roblox updated the sky because it used to work

Use tween service its a good way to make a day night cycle.

local tweenservice = game:GetService("TweenService")

  local info = TweenInfo.new(10, Enum.EasingStyle.Linear, Enum.EasingDirection.In, -1, true, 0)

   local goals = {

 ClockTime = 0

}

local tweentime = tweenservice:Create(game.Lighting, info, goals)

tweentime:Play()
  1. Is it a server script

  2. heres the script i use.

    while wait() do
    
     game.Lighting.ClockTime += 0.001
    
    end