local minutesAfterMidnight = 0
while true do
game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight)
minutesAfterMidnight = minutesAfterMidnight + 1
wait(0.1)
end
✓ ANSWER ACCEPTED
How do I make it so that the server starts at daytime and how do I change the length of night/day?
1 answer
✓ Accepted answer
local minutesAfterMidnight = 0
Think about it like seconds after daytime, say you want time to start the 7th hour (7am)
You'd want 7 hours into seconds so you can do something like:
local minutesAfterMidnight = 7 * 60 * 60
[EDIT]
If you wanted to have a ratio, so you could decide exactly how long a 24 hour cycle is you can use the below:
local dayLength = 24
local cycleTime = dayLength * 60
local minutesInADay = 24 * 60
local minutesToAdd = minutesInADay / cycleTime
-- use this below in your while loop
minutesAfterMidnight += minutesToAdd
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
yes thank you but how would i make it so say daytime is 24 minutes long
local dayLength = 24 local cycleTime = dayLength * 60 local minutesInADay = 24 * 60 local minutesToAdd = minutesInADay / cycleTime minutesAfterMidnight += minutesToAdd
is that a new script or just something i should add to it?