Is there any way to change light environment with lua?

Is there any way to change light environment with lua? (For Example: GM_FLATGRASS map)

No, it is impossible, unless you have a map with a named light_environment, (like RP_Evocity_V17x or the map in this upload http://www.garrysmod.org/downloads/?a=view&id=75912). If you do find a map you can change the light_environment with some code like this:


local lightenvs = ents.FindByClass("light_environment")
for _, light in pairs(lightenvs) do
    if (ValidEntity(light)) then
         light:Fire( 'FadeToPattern' , 'a' , 0 ) // Makes the light fully dark, z is fully bright.
    end
end


can you post that script: http://www.garrysmod.org/downloads/?a=view&id=75912
I can’t open it