Muzzle Flash script

Does anybody have an actual working muzzleflash script, Accurate for the colt 45? all the scripts ive tried to use have not worked at all…

Heres the one im trying to use now:


    var muzzleFlash : ParticleEmitter; //Your emitter prefab
    var gunEnd : Transform; //An empty gameobject positioned at the end of the gun as a child
    //Call OnShooting() from somewhere in your firing script
    function OnShooting () {
       Instantiate(muzzleFlash, gunEnd.position, gunEnd.rotation);
       yield WaitForSeconds (0.2);
    }

Can someone fix it for me or hook me up with a new one?

Thanks in advance

muzzleFlash.transform.localRotation = Quaternion.AngleAxis(Random.value * 360, (Put your vector here, without these 2 brackets ));
muzzleFlash.enabled = true;
muzzleLight.enabled = true;
audio.clip = (Audio clip here for shooting , without brackets);
audio.Play();
yield WaitForSeconds(0.02);
muzzleFlash.enabled = false;
muzzleLight.enabled = false;
yield WaitForSeconds(kickbackTime);

If this didn’t work tell me and ill fix it

If you are still at all unclear, this tutorial covers a muzzle flash amongst other things.

Might interest you and help you understand it better.

http://www.unity3dstudent.com/2011/01/worms-style-power-bar/