Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Time = 10 -- how much time you want the day last, example: 10 mean 10 minute in real life
- local converted = 24 / Time / 60 / 2
- local clocktime = 7 -- you can choose when server start, what clock time should be example 7 mean 7 am in your game
- local PhaseIndex = 0
- local DayFinished = false
- local MoonPhase = {
- "rbxthumb://type=Asset&id=16106114762&w=420&h=420",-- you can add more, but make sure you follow the format
- "rbxthumb://type=Asset&id=16106117102&w=420&h=420",
- "rbxthumb://type=Asset&id=16106102598&w=420&h=420",
- "rbxthumb://type=Asset&id=5385993191&w=420&h=420"
- }
- game:GetService("RunService").Heartbeat:Connect(function(frameTime)
- clocktime = (clocktime + frameTime * converted) % 24
- end)
- while true do
- game.Lighting.ClockTime = clocktime
- if clocktime >= 17 and not DayFinished then
- DayFinished = true
- PhaseIndex = (PhaseIndex % #MoonPhase) + 1
- if game.Lighting:FindFirstChildOfClass("Sky") then
- game.Lighting:FindFirstChildOfClass("Sky").MoonTextureId = MoonPhase[PhaseIndex]
- else
- print("Create a sky, or moon phase wont work")
- end
- elseif clocktime <= 17 then
- DayFinished = false
- end
- task.wait(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement