Ad
Log in to vote
-3

How to perform day/night cycle?

Asked by 7 years ago

Okay, I want the day/night cycle to be performed in my game, so here is the script I made.

local.display(skybox)
    skybox = ("66944469")
        wait(600) -- 600 seconds = 10 minutes.
    skybox = ("123072184")
        while true do
            local function(repeat)
    end  -- Ends the rotate script.
        end) -- Ends the Repeat

I honestly tried my best, but I couldn't figure it out. Thank you for your help guys!

0
Please learn how to ACTUALLY script before you attempt this. RedCombee 585 — 7y

3 answers

Log in to vote
1
Answered by 7 years ago

It's simpler than you think, my friend!

local x = 0.1 -- The speed

while wait(x) do 
    game.Lighting.TimeOfDay = game.Lighting.TimeOfDay .. 1 
end
Ad
Log in to vote
0
Answered by 7 years ago

while wait(1.0) do game.Lighting:SetMinutesAfterMidnight(game.Lighting:GetMinutesAfterMidnight()+1); end <-- simple way! Works.

Log in to vote
0
Answered by 5 years ago

Roblox Wiki made an article on this, reading the rest may help as well

Answer this question