Mapping / Lua Question/Help Fog & FarZ

Hello there Awesome people.

I was having some troubles trying to change our server’s Map FOG FarZ distance using lua.

Being direct and quick, the map is rp_rockford, the fog FarZ is higher than 5000, and we need to lower it down to 4000.

So…
The Author said this to us:

If you really want to, you can use lua to modify it.
Just find the fog entity by either v:GetClass()==“env_fog” or v:GetName()==“thefog” and setting the key ‘farz’ to something higher then 5000.

And im not sure about how to use the information he delivered to us, anyone’s kind or cool enough to reply us the solution please? :slight_smile:

This is how far i tryed to make some kind of n00b mix
(i know isn’t working like this down here, i was just guessing)



for k,v in pairs(ents.GetAll()) do if v:GetClass()=="env_fog" then v:SetFarZ (4000) end end

Unrelated to your post, but you could use

ents.FindByClass instead of ents.GetAll() and v:GetClass().