How do I destroy a gameobject after 5 seconds

I have this shoot script:

var projectile : Rigidbody;

var speed = 20;

function Update() 

{

    if( Input.GetButton( "Fire1" ) ) {

        var instantiatedProjectile : Rigidbody = Instantiate(

projectile, transform.position, transform.rotation );

 

        instantiatedProjectile.velocity =

transform.TransformDirection( Vector3( 0, 0, speed ) );

        

        Physics.IgnoreCollision( instantiatedProjectile. collider,

transform.root.collider );

    }

}

And I want the bullets to go away after 5 seconds.

Thanks

Look at the Destroy function:

Destroy(objReference, timerInSeconds);

Destroy (gameObject, 5);