Play animation on collision of a "cube"

I want to be able to play an animation when my fps object collides with a cube, how can i do this?

        var door : GameObject; //Drag door to inspector view
var creak : AudioClip;//Drag sound clip to inspector view

function collider() {
    door.animation.Play("Open");
    door.audio.PlayOneShot(creak);
}

this is my JavaScript I have....

Set the Cube with it's own Tag an then run a Oncollision script. Like so:

OnCollisionEnter(collision:Collision)
{

    if(collision.gameObject.CompareTag("Cube"))
    {
//Play animation
}

}

May not be 100% accurate but you get the idea.