Play Animation OnTriggerEnter

I have a door script that is supposed to play an animation when I walk in the trigger and then also play a door opening sound. I have the same thing but except it is OnTriggerExit and it plays the sound and lays a close animation. The problem is, is that the sound is playing only on the trigger functions, but none of the animations are playing.

#pragma strict

var Door : GameObject;
var OpenSound : AudioClip;
var CloseSound : AudioClip;

function OnTriggerEnter(Other : Collider)
{
	if(Other.gameObject.tag == "Player")
	{
		Door.animation.Play("SlidingDoor_Open");
		audio.clip = OpenSound;
		audio.Play();
	}
}

function OnTriggerExit(Other : Collider)
{
	if(Other.gameObject.tag == "Player")
	{
		Door.animation.Play("SlidingDoor_Close");
		audio.clip = CloseSound;
		audio.Play();
	}
}

I Think this should work

#pragma strict

var door : Animation;
var OpenSound : AudioClip;
var CloseSound : AudioClip;
 
function OnTriggerEnter(Other : Collider)
{
    if(Other.gameObject.tag == "Player")
    {
       door.Play("SlidingDoor_Open");
       audio.clip = OpenSound;
       audio.Play();
    }
}
 
function OnTriggerExit(Other : Collider)
{
    if(Other.gameObject.tag == "Player")
    {
       door.Play("SlidingDoor_Close");
       audio.clip = CloseSound;
       audio.Play();
    }
}

can someone please repost this in c#? im sure im just making one simple mistake. but when i go back to say “doorClose” is quickly loops between say " close and open". ?

btw i did not get the code from this question. this is my code here.

using UnityEngine;
using System.Collections;

public class PlayerController : MonoBehaviour {

public Animator anim;

public float speed;
public float idleSpeed;

void Awake()
{
	anim = GetComponent <Animator> ();

	speed = 5f;
	idleSpeed = 0f;
}

void Update () 
{
	if (Input.GetMouseButton (0)) 
	{
		transform.Translate (Vector3.forward * idleSpeed * Time.deltaTime);
		anim.SetBool ("Idle", true);
	} 
	else 
	{
		transform.Translate(Vector3.forward * speed * Time.deltaTime);
		anim.SetBool ("Walk", true);
	}
}

}