top of page

HOW TO DO A DAY/NIGHT CYCLE
 
IN ROBLOX STUDIO

Day Night Cycle Script photo.PNG

                    STEP 1

First, you will need to have the Explorer Tab and the Properties Tab open by clicking VIEW on the top of your screen then click Explorer and Properties.

Go to ServerScriptService and click the plus then click script. Click the script and go to properties (Or press F2 on your keyboard) and rename it Day/Night Cycle. Therefore, if you need to delete or edit a script, you don't have to view all of them to get the right one.

Day Night Cycle Explorer Tab.png

STEP 2

Secondly, you'll need to type the script its self.

To do this, you need to double left-click the script (WHATEVER YOU NAMED IT) then delete 'Print Hello World!' and start typing the script from the picture at the top of the page                       or the steps below.

STEP 3

Next, type in:

local Time = 0.01

local TimeChange = 0.01

3

while wait(Time) do

game.Lighting.ClockTime = game.Lighting.ClockTime+TimeChange

end

Do NOT type in the numbers on the very left of the script. It's just to show what line number you need to be on for each line of script/code so it works.

There are single spaces but not double spaces or more.

​

Tip: In this script, there's no spaces at the very start of a line.

STEP 4

Now, that's your script done! 

Finally though, you need to press x next to the script name next to the baseplate or whatever your game is called.

Press F5 on your keyboard and watch the sun rise and set and moon rise and set. The numbers on the first 2 lines you can change to whatever you want, the lower the number, the smoother it goes. EXPERIMENT ON THIS AND MORE THNIGS ON THE SCRIPT!

bottom of page