Simple Shoot script

I’m using for my grappling gun–

var projectile : Rigidbody;
var speed = 20;

function Update () {
    if ( Input.GetButton ("Fire1")) {
        Instantiate(projectile, transform.position, transform.rotation);
        velocity = transform.TransformDirection( Vector3 (0, 0, speed));

        if ( Input.GetButton ("Fire2"))
            Destroy;
    }
}

Theres probably several errors in here but what i actually need help on is getting this java script for my gun to destroy the projectile after it was spawned but with the click of a button preferably the right click. How would go about typing JUST that part of da script the above is my attempt. DO ask questions on anything else not understood I will tell you what it is I am doing… x)

-johnny

Oh I’m so sorry, PLEASE help me. It’d be much appreciated

if ( Input.GetButton (“Fire1”))
{
//you need to assagin the object to a varible so you can destory it later
var clone : GameObject = Instantiate(projectile, transform.position, transform.rotation); velocity = transform.TransformDirection( Vector3 (0, 0, speed));
}
if ( Input.GetButton (“Fire2”))
{
Destroy(clone);
}

THANK YOUUU Fr0sZ ! !! It works! XD BlAHAHA