-- in order to use this code ,save this file with the name lightzonesurface.lua -- just add in a triggerzone anywhere you'd like to -- have an overall change in the ambient light level , such as entering a cave -- or going inside to outside or vice versa -- just add this .lua file in to the triggerzone and in Properties , in the NAME field -- put in the number value (0.0 - 3.3) of the surface light level you'd like to have -- at that part of the map -- 0.0 = surface light fully off -- 3.3 = surface light at 100% -- to have a better understanding of the real level between 0 and 100% -- the number you need to input in the NAME area should be the % of overall -- surface light you would would liek to have visible at that point in your map -- DIVIDED by 33 -- so if you'd like the light at 25%..........25 divided by 33 = .75 -- just experiment with numbers between (0.0 - 3.3) and you'll get it fast local change_amount = {} local plyr_in_zone = {} function lightzonesurface_init_name(e,name) change_amount[e] = tonumber(name) plyr_in_zone[e] = 0 end function lightzonesurface_main(e) if g_Entity[e]['plrinzone']==1 then if plyr_in_zone[e] == 0 then SetSurfaceIntensity(change_amount[e]) ActivateIfUsed(e) plyr_in_zone[e] = 1 end else plyr_in_zone[e] = 0 end end