Sparks for unity raycast gun script

I have a raycast gun script and for the particle spark effect i have use Var Effect : Transform; and when i got to drag my sparks into the effect box the sparks wont work when i shoot my gun.

var endBarrel :Transform; 
var sound : AudioClip;
var TheDamage = 100;
var Effect : Transform;
var Enemy : GameObject[];
 
function Start()
{
 
}
 
function Update()
{
  var hit : RaycastHit;
 
  if(Input.GetButtonDown("Fire1"))
  {
    // you can use PlayOneShot to specify the sound...
    audio.PlayOneShot(sound);
 
    audio.Play();
  }
 
  if (Input.GetMouseButtonDown(0))
    {
      if (Physics.Raycast (endBarrel.position, transform.forward, hit, 500))
      {
          Debug.DrawRay(endBarrel.position, endBarrel.forward * 100);
         hit.transform.SendMessage("ApplyDamage", TheDamage, SendMessageOptions.DontRequireReceiver);    
      }
    }
  }

Try this. Make your effect variable a GameObject and create a new variable and call it something like Muzzle and make it a GameObject. The muzzle should be an empty by the way. Place the muzzle in front of your gun then type this into the update function:

function Update ()

if(Input.GetButtonDown(“Fire1”))

{

Instantiate(Effect, Muzzle.transform.position, Muzzle.transform.rotation);

}

Best of luck!