I might've interpreted this wrong, but I'm assuming you want a day/night cycle script.
Here's what I would do:
1 | minutesAfterMidnight = 12 * 60 |
3 | minutesAfterMidnight = minutesAfterMidnight + 0.15 |
4 | game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight) |
The script itself is simple, but here's a basic breakdown:
The initial minutesAfterMidnight
variable defines the starting time. The 12 is the hour and it multiplies it by 60 to get the minute.
It then loops it though, adding 0.15 minutes for every 0.05 seconds that passes in real life. You can play around with those values to get the desired rate. I wouldn't recommend changing the 0.15 value too high as it makes the sun/moon's movement really choppy and weird.
Hope this helps :)