Custom MuzzleFlashes

Hello everyone! i’m trying to find a way to create custom muzzleflashes. i went ahead and looked at the WIKI and searched for muzzleflashes, but it appears as if its just a function. the flash itself just looks like a VTF somewhere. i’m fairly good with editing VTF’s, but does anyone know how i can define a custom muzzleflash, and what VTF to use for it using lua inside my SWEP’s?

Just do what Jinto did here.

You also just get the muzzle material, use SetMaterialString to change the $basetexture right before drawing and then set it back but thats hacky.