-- LUA Script - precede every function and global member with lowercase name of script + '_main' local timeset = 0; local time1 = 0; local time2 = 0 --set value here to delay desired between each cycle (in seconds) --60 = 1 min ... / ... 120 = 2mins ... etc local cycle_time = 30 --turn fog on/pff (1/0) local fogon = 1 --set to 0 if you want to use a custom fog colour) local fogcolouron = 1 --set to 0 if you want to use the ambiance slider (set to 1 for quicker darkness at night) local ambi = 1 local contraston = 1 --set to 1 to start during the day, 0 to start at night local daytime = 1 --time of day/night (0 = midday/midnight) local change = 50 --set to 1 to display the prompt on screen local optional_prompt = 1 ---------do not change below unless you understand :) cycle_time = (cycle_time / 60) * 1000 function day_night_init(e) end function day_night_main(e) if timeset == 0 then time1 = GetTimer(e) timeset = 1 end --optional prompt to show speed of change in numbers if optional_prompt == 1 then Prompt(change) --optional prompt to show how quickly day/night is changing end time2 = GetTimer(e) if fogon == 1 then SetFogNearest(change * 100) SetFogDistance(change * 400) end if fogcolour == 1 then SetFogRed(4) SetFogGreen(4) SetFogBlue(4) end if ambi == 1 then SetAmbienceIntensity(change) end SetAmbienceRed(change) SetAmbienceGreen(change) SetAmbienceBlue(change) SetSurfaceRed(change) SetSurfaceGreen(change) SetSurfaceBlue(change) if contraston ==1 then SetContrast(change) SetContrast(20) end if time1 + cycle_time < time2 then time1 = GetTimer(e) if daytime == 0 then if change == 0 then daytime = 1 else change = change - 1 end end if daytime == 1 then if change == 100 then daytime = 0 else change = change + 1 end end end end