From a newbie: referencing variable values in another script

OK, I know this issue has been addressed before. But I'm really new and didn't understand the answer.

Basically what's going on is that in the Lerpz 3D game (which comes with a tutorial on the Unity site) I want to have the robot say different things to Lerpz depending on how many lives Lerpz has left.

Here's what I have so far (please tell me if this is wrong)

I created three more attackSound variables in the EnemyPoliceGuy script:

var attackSound2 var attackSound3 var attackSound4

and at the top of the EnemyPoliceGuy script I also attempted to refer to the "lives" variable in the ThirdPersonStatus script:

var lives:ThirdPersonStatus //Is that part right?

Then later in the EnemyPoliceGuy script I took a shot in the dark and did this, which does not work:

if (attackSound)
{
    if (audio.clip != attackSound)
    {
        if (lives = 4)
        audio.Stop();   // stop the idling audio so we can switch out the audio clip.
        audio.clip = attackSound;
        audio.loop =false;  // change the clip, then play
        audio.Play();
        if (lives = 3)
        audio.Stop();   // stop the idling audio so we can switch out the audio clip.
        audio.clip = attackSound2;
        audio.loop =false;  // change the clip, then play
        audio.Play();
        if (lives = 2)
        audio.Stop();   // stop the idling audio so we can switch out the audio clip.
        audio.clip = attackSound3;
        audio.loop =false;  // change the clip, then play
        audio.Play();
        if (lives = 1)
        audio.Stop();   // stop the idling audio so we can switch out the audio clip.
        audio.clip = attackSound4;
        audio.loop =false;  // change the clip, then play
        audio.Play();
    }
}

Can someone tell me what I did wrong and how I should change it?

Thank you!

A couple of problems with your script: you need to put brackets around the stuff in your if statements and when comparing you need to use 2 equal signs instead of 1 like this: if(lives == 4)

Change this (and all your other if statements):

if (lives = 4)
        audio.Stop();   // stop the idling audio so we can switch out the audio clip.
        audio.clip = attackSound;
        audio.loop =false;  // change the clip, then play
        audio.Play();

To this:

if (lives == 4) {
        audio.Stop();   // stop the idling audio so we can switch out the audio clip.
        audio.clip = attackSound;
        audio.loop =false;  // change the clip, then play
        audio.Play();
}

You should have gotten a bunch of red errors in the Console, check there and it'll usually give you a hint at what's wrong.

Thank you!! That helped a lot!