
Version: 1.1
Description
This script adds a day and night cycle to the game and forces players to use lighting engine. Also the night isn't "too dark" like normally by default is.
Config
dayDuration- Length of the day in seconds
dayRange- Array[0] start and Array[1] end of the day in 360 degrees
nightRange- Array[0] start and Array[1] end of the night in 360 degrees

dayRangeand
nightRangemust fit together the 360 degrees and can't be lower than 1. Also the lower values night has, the shorter it will be.
API
DAY_NIGHT_CYCLE.setTime(time)
- Sets current time in 360 degrees and returns mapped time for 
DAY_NIGHT_CYCLE.isNight()- Returns
true
if the current cycle is nightDAY_NIGHT_CYCLE.isDay()- Returns
true
if the current cycle is dayInstallation
Put the script inside sys/lua/autorun directory.


edited 10×, last 09.03.23 10:39:00 am
Approved by DC
Download
728 b, 416 Downloads