Audio script doesn't work

Hi everyone , so i have a script which you will see in a second and basicly what i want it to do is play music trough out different scenes without restarting or stopping when going to another scene ,but i also want to stop it when my main level scene begins (BehindLocks)
but unity says expecting : ,found ;
could anyone help me out please?
this is my script

function Awake ()
{
        DontDestroyOnLoad (transform.gameObject);
}
    
    
{
  If(Application.loadedLevel == "BehindLocks");
  audio.Stop();
}

After formatting your code for you, maybe you can see the problems.

  1. The second paragraph is not in the Awake function so remove the middle } {
  2. ‘If’ should be ‘if’
  3. the ; at the end of that ‘If’ line should be deleted

so should it be like this?
function Awake ()

    DontDestroyOnLoad (transform.gameObject);

{
if(Application.loadedLevel == “ScaryHorrorGame”)
audio.Stop();
}

because it doesn’t work