how do i play an animation when i press a key

function Update () {

if(Input.GetButtonDown(fire1)){
}
}

what would i put in the if statement to play my animation

http://unity3d.com/support/documentation/ScriptReference/Animation.Play.html

You’re going to want to do:

function Update()
{
   if (Input.GetButtonDown(fire1))
   {
      Animation.CrossFade("MyAnimation");
   }
}

or

function Update()
{
   if (Input.GetButtonDown(fire1))
   {
      Animation.Play("MyAnimation");
   }
}

It just depends if you have any other animations going.