Scripting error related to variables....

I am getting errors for some reason that has to do with my variables (gainmen) please help...

Here is my code:

function OnTriggerEnter (other : Collider) {
    yield WaitForSeconds(1);
    if(other.gameObject.name == "reachedtarget") {
       if(other.gameObject.CompareTag(this.tag)) {  
  var mennum : waypointSoldier = other.GetComponent(waypointSoldier);
  var gainmen = mennum.mencount;
count + gainmen;
}
 else {
count - gainmen;
      } 

   }   

}

Thanks in advance.

count - gainmen;

it's the line with error. it should be -=

What does the error say in the console?

You're not actually storing the result of "count + gainmen" - you're just calculating it and discarding it.

The error is probably to do with the fact that you're declaring 'gainmen' inside an if statement but referencing it in the else.