Math/Scripting issue

(Sorry if this is the wrong caterogy)

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.

Change your wait time to 1/30. Let me know if that works.

1 Like

That seems to make it go lightspeed

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)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.