How to Add a Day-Night Cycle in Roblox Studio with Code (Beginner-Friendly Tutorial)
Channel | Publish Date | Thumbnail & View Count | Download Video |
---|---|---|---|
Publish Date not found | 0 Views |
Learn how to script, code, program, and develop a day-night cycle feature to add to your game in Roblox Studio, compatible with PC, mobile, and XBOX devices.
#chrisatm #roblox #robloxdev
Code (script in ServerScriptService):
local RunService game:GetService(/"RunService/")
local lighting game:GetService(/"Lighting/")
local function updateTime()
local current time lighting.time
local time interval 0.1
local new time current time time interval
Lighting.Time newTime
End
RunService.Heartbeat:Connect(UpdateTime)
Please take the opportunity to connect with your friends and family and share this video with them if you find it useful.