triggering an animation when open a door ?

Like the title says, I have a open/close door animation and I want an another animation to play when I open the door and only when I open the door. Here the script I used to trigger the door animation:
#pragma strict

private var guiShow : boolean = false;

var isOpen : boolean = false;

var door : GameObject;

var rayLength = 10;

var customSkin : GUISkin;

var DoorOpenSound : AudioClip;

var DoorCloseSound : AudioClip;

function Update()
{
	var hit : RaycastHit;
	var fwd = transform.TransformDirection(Vector3.forward);
	
	if(Physics.Raycast(transform.position, fwd, hit, rayLength))
	{
		if(hit.collider.gameObject.tag == "Door")
		{
			guiShow = true;
			if(Input.GetKeyDown("e") && isOpen == false)
			{
				door.animation.Play("OpenDoor");
				isOpen = true;
				guiShow = false;
				audio.PlayOneShot(DoorOpenSound);
			}
			
			else if(Input.GetKeyDown("e") && isOpen == true)
			{
				door.animation.Play("CloseDoor");
				isOpen = false;
				guiShow = false;
				audio.PlayOneShot(DoorCloseSound);
				
			}
		}
	}
	
	else
	{
		guiShow = false;
	}
}

function OnGUI()
{
	if(guiShow == true && isOpen == false)
	{
	    GUI.skin = customSkin;
		GUI.Box(Rect(Screen.width / 2, Screen.height / 2, 100, 25), "E open");
	}
	if(guiShow == true && isOpen == true)
	{
	    GUI.skin = customSkin;
		GUI.Box(Rect(Screen.width / 2, Screen.height / 2, 100, 25), "E close");
	}
}

Do you mean a randomised animation? If so, what you could to is store the door-opening animations in an array and reference that array with Random.Range (0, its length) as the index.

Hi .
simply use OnCollisionEnter method .
some how it looks like .
attach gameobject to your door .

void OnCollisionEnter(Collision coll)
        {
        
        	if (coll.gameObject.tag=="Name_of_your_door") {
        		GameObject(like door).animation.Play("DoorOpenAnimation");
        	}
        }