How to MAKE a Day/Night Cycle?🛠️| Roblox Studio 2025 Tutorial
Автор: OfficialOwenn
Загружено: 15 апр. 2025 г.
Просмотров: 370 просмотров
In this tutorial, I’ll show you how to create a smooth and realistic day/night cycle for your Roblox game using just a few lines of code.
Leave a like and subscribe if this was helpful!✨
-----------------------------------------------------------------------------------------------------
--------------------------------------------------
Script:
local Lighting = game:GetService("Lighting")
-- Customize durations (in seconds)
local DAY_LENGTH = 10
local NIGHT_LENGTH = 10
-- Total minutes in day/night periods
local MINUTES_PER_HALF_DAY = 12 * 60 -- 720 minutes
while true do
-- Day: 6 AM to 6 PM (360 to 1080 minutes)
for minutes = 6 * 60, 18 * 60 do
Lighting:SetMinutesAfterMidnight(minutes)
task.wait(DAY_LENGTH / MINUTES_PER_HALF_DAY)
end
-- Night: 6 PM to 6 AM (1080 to 1440, then 0 to 360 minutes)
for minutes = 18 * 60, 24 * 60 - 1 do
Lighting:SetMinutesAfterMidnight(minutes)
task.wait(NIGHT_LENGTH / MINUTES_PER_HALF_DAY)
end
for minutes = 0, 6 * 60 - 1 do
Lighting:SetMinutesAfterMidnight(minutes)
task.wait(NIGHT_LENGTH / MINUTES_PER_HALF_DAY)
end
end
-------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------
Tags:
Roblox Studio Tutorial
Roblox Studio
Studio Tutorials
#roblox #tutorial #develpment #dev #help #2025 #robloxstudio #robloxstudiotutorial

Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: