LightingTime v1.0

LightingTime can be used to coordinate the day-night cycle with other in-game features, for example clocks.

Warning: This version is outdated as LightingTime v2.0 released on July 16th, 2025. View the new post here

Link to model: https://create.roblox.com/store/asset/135153527539252

Documentation:

The model needs to be required using

LightingTime = require(game.ServerScriptService.LightingTime)

You can change it to wherever you put the ModuleScript but I recommend storing it in ServerScriptService.

Default values:

TimeSpeed: 0 (no time changes at all)
TimeOfDay: 14.5*3600 (2:30 PM in seconds)
UpdateLightingAuto: true
UpdateLightingFrequency: 3 (updates every 3 seconds)

Functions:

LightingTime.SetTimeSpeed(value)
Sets the speed for the time to change
Returns: nil

LightingTime.SetTimeOfDay(hour, min, sec)
Sets the time of day
Returns: nil

LightingTime.GetTimeInSeconds()
Returns: number (time of day in seconds)

LightingTime.GetTimeInHours()
Returns: number (time of day in hours)

LightingTime.GetTimeInMinutes()
Returns: number (time of day in minutes)

LightingTime.GetHour()
Returns: number (the current hour)

LightingTime.GetMinute()
Returns: number (the current minute)

LightingTime.GetSecond()
Returns: number (the current second)

LightingTime.GetFormattedTime(format)
Formats:
“hm” returns: string (hour and minute)
“hms” returns: string (hour, minute and second)
Other formats return: nil

LightingTime.GetTimeFromTimezone(timezone)
Returns: number (the time in the specified timezone in seconds)

LightingTime.SetTimeFromTimezone(timezone)
Sets the time as the real life time in the specified timezone
Returns: nil

LightingTime.SetLightingUpdateFrequency(value)
Sets the update frequency for lighting in seconds, 0 is not updating
Returns: nil

Thank you for reading this post, I really hope this could help.
If you have questions, feel free to ask, and if you have any update ideas/requests, feel free to tell me.

5 Likes