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

Make a Day/Night Script?

Asked by
steev 0
10 years ago

I want a day and night script. It takes 1 hour to get to night and it takes 1 hour to get to day.

Can anyone help me?

Thank you.

1 answer

Log in to vote
0
Answered by 10 years ago

This is actually really easy if you know what you're doing. There are two functions that go hand in hand to make this possible.

while wait() do
game.Lighting:SetMinutesAfterMidnight(game.Lighting:GetMinutesAfterMidnight()+0.05)
end

This is what I use, but you can change the "0.05" to whatever you want and it changes the speed of the sun's movement in the sky.

Ad

Answer this question