✓ Accepted answer
I might've interpreted this wrong, but I'm assuming you want a day/night cycle script.
Here's what I would do:
minutesAfterMidnight = 12 * 60
while true do
minutesAfterMidnight = minutesAfterMidnight + 0.15
game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight)
wait(.05)
end
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 :)
3 comments
And to your code above, I didn't really get what you're trying to do with the "mins" variable, so I don't really know how to correct it. You never specified an increment either. Plus, it seems like you want it to go on forever, so it's better to use "while true do". If you don't want it to repeat forever, you can always pause or stop it by changing the "true" to something else.
Thankyou @Bob4koolest
yep, np