toolgun (changes color of map)

There is a tool gun that you can script and change the color of the map its like a forbidding tool or mod can some one plz send me the code or teach me how to code it.