Slow automatic shooting script?

Hi, i am having a problem, i currently have the script below that shoots a projectile (it is semi-automatic). i know how to change it to automatic, just change the GetButtonDown to GetButton, but that it too fast for what i want, please can you help me change the fire rate (preferably using a variable) so that it shoots automaticly but for the fire rate to be around 0.5.
thanks

var projectile : Rigidbody;
var speed = 20;
function Update()
{
if( Input.GetButtonDown( "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 );
}
}

Coroutines are what you probably want to use for this case:

http://unity3d.com/support/documentation/ScriptReference/Coroutine.html

I’ve modified your script. Now, the variable “rate” controls the amount of time between a projectile and another (0.5 seconds, in the declaration).

var projectile : Rigidbody;
var speed = 20;
var rate : float = 0.5;
private var rate_time : float;

function Update()
{
   if( Input.GetButtonDown("Fire1") && Time.time > rate_time)
   {
      rate_time = Time.time + rate;
      var instantiatedProjectile : Rigidbody = Instantiate(projectile, transform.position, transform.rotation );
      instantiatedProjectile.velocity = transform.TransformDirection( Vector3( 0, 0, speed ) );
      Physics.IgnoreCollision( instantiatedProjectile. collider, transform.root.collider );
   }
}