Applying one texture on another using a mask texture

You may also want to look at: Spray/Decal Script