How to make bullet holes on terrain?

How do I make bullet holes or some sort of mark caused by a bullet on terrain? Currently my bullets are destroyed on collision, but I want them to leave a bullet hole. I would prefer Javascript. I searched on Google and couldn’t find anything (typical Google :/)

One way: create a “bullet hole” splat texture in the terrain editor. Don’t paint with it for real, but do a test: set the brush size to 1 (or 2) and try to paint some bullet holes are certain spots. If that looks OK, then make the code paint it for you.

Look up how to read/change splat textures in code. When-ever a bullet hits the ground, redo those squares (set the bullet texture to weight 1, everything else to 0.) One old Q about this