Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How do I make each day last longer?

Asked by
HBVAN2 0
8 years ago

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

0
wait(1) means wait 1 second so change it a higher number.. User#12356 0 — 8y

2 answers

Log in to vote
0
Answered by
Leyssia 25
8 years ago
Edited 8 years ago

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

0
these people that just copy script from somewhere makes me laugh xD User#12356 0 — 8y
0
You and me both xD I just wish they would take the time to learn this stuff if they wanted to use it Leyssia 25 — 8y
Ad
Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

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

Answer this question