I made a day and night cycle script, but I cannot figure out the math so 1 day is 24 minutes because thats just how dumb I am. Here is the script:
local WaitTime = 1
local Change = 0.001 -- 2 seconds is 0.001 (1 minute is 0.03)
while task.wait(WaitTime) do
game:GetService("Lighting").ClockTime += Change
end
I dont want to change the “Change” variable value that much because I want the sun/moon to orbit around smoothly.
I found a good way to do the math which seemed to work
I first made the day last 24 minutes (each minute is equal to an hour) and then I just divided the variables by 2. (wrote this extra sentence for the few people who might have this math issue)