mario like cannon

Hi I wanted to make cannon like in Mario Bros.
Right now it shoots bullets. I have 4-second looped animation so the bullet restarts in the cannon efter hitting the wall. So here comes the problem, bullet can either hit me and be destroyed or go through me, hit the wall and restart in cannon. I want it to hit me and then restart in the cannon.

My code so far:

#pragma strict
    var bullet : GameObject;
    var effect : Transform;
    function OnTriggerEnter ()
    {
    Destroy(bullet);
    Instantiate(effect, transform.position, transform.rotation);
    }
    function Update () {
    }

I good way to do this is this.

(sorry, this is C#. C$ is the only thing I’m famillier with :))

public GameObject bullet;
	public Transform effect;

	void OnTriggerEnter(Collider colT)
	{
		if (colT.tag == "Mario")
		{
			Destroy(this);
			Instantiate(effect, transform.position, transform.rotation);
		}

		else if (colT.tag == "Wall")
		{
			Destroy(this);
			Instantiate(effect, transform.position, transform.rotation);
		}

		else
		{
			return;
		}
	}

	void Update()
	{

	}