Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make each day last longer?

I wrote a day/night script and it changes really quick, how do I make each day last longer?

game.Lighting:SetMinutesAfterMidnight(5 * 60) wait(1) game.Lighting:SetMinutesAfterMidnight(6 * 60) wait(1) game.Lighting:SetMinutesAfterMidnight(7 * 60) wait(1) game.Lighting:SetMinutesAfterMidnight(8 * 60) wait(1) game.Lighting:SetMinutesAfterMidnight(9 * 60) minutesAfterMidnight = 0 while true do minutesAfterMidnight = minutesAfterMidnight + 1 game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight) wait(.1) end

1 comment

0

wait(1) means wait 1 second so change it a higher number..

2 answers

✓ Accepted answer

Much like Fearme987 said, just change the number inside the parenthesis after "wait"

Example: Wait(60)

That will make it wait 60 seconds before actually changing the time of day, I also suggest checking out the wiki page below on how to create a day/night script. It shows you how to loop it, make it shorter, and even make things happen at certain times of day!

http://wiki.roblox.com/index.php?title=Making_a_Day/Night_Cycle

2 comments

0

these people that just copy script from somewhere makes me laugh xD

0

You and me both xD I just wish they would take the time to learn this stuff if they wanted to use it

Or you could if u wanna go by hour then do this

minutesAfterMidnight = 0
while true do
    minutesAfterMidnight = minutesAfterMidnight + 60
    game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight)
    wait(60) -- Where 1 hour(in game)  = 1 minute(real life)
end

if you want time to change every minute then do this

minutesAfterMidnight = 0
while true do
    minutesAfterMidnight = minutesAfterMidnight + 1
    game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight)
    wait(1) -- Where 1 minute (in game)  = 1 second (real life)
end

This discussion is preserved as it was. New answers, comments, and votes are closed.