Sound effect on right click

I’m trying to make my script play an audio sound when I right click, to open the door.

Here is a part of my code (javascript):

if(enter == true){
if(Input.GetButtonDown("Fire2")){
open = !open;
}
}

You must add an AudioSource to the door, define the sound to be played in the Clip property and play the sound with audio.Play():

if(enter == true){
  if(Input.GetButtonDown("Fire2")){
    open = !open;
    if (open) audio.Play(); // play audio if door is opening 
  }
}