I cant figure out these errors

I dont know what is wrong with this script but it has four errors being. Assets/My Scripts/Collision Score.js(44,34): BCE0044: expecting :, found ‘{’,

Assets/My Scripts/Collision Score.js(44,26): BCE0044: expecting (,found ‘OnGui’.

Assets/My Scripts/Collision Score.js(43,38): BCE0043: Unexpected token: 0,

Assets/My Scripts/Collision Score.js(43,37): BCE0044: expecting ), found’=’

And my script is

#pragma strict
var ZombieCyrus : Rigidbody;
var ZombiePatterson : Rigidbody;
var ZombieBeiber : Rigidbody;
var TargetsRemaining : int = 3;
var OnGui : GuiLabel;

function Start () {
ZombieCyrus.enabled = true;
ZombiePatterson.enabled = true;
ZombieBeiber.enabled = true;

}

function Update () {

//if(collision.enabled == true)

}
function OnCollisionEnter(collision : Collision){
	if (collision.collider.tag == "ammo"){
		Debug.Log("block detecting collision by"+collision.collider.tag);
			// if the bullet hits the zombies collision detection;
			Destroy(gameObject);
		//ZombieCyrus.enabled = false;
	}
}
	
//if (ZombieCyrus = false){
//		TargetsRemaining = TargetsRemaining - 1;
//		}
//
//
//if (ZombieBeiber = false){
//		TargetsRemaining = TargetsRemaining - 1;
//		}
//
//if (ZombiePatterson = false){
//		TargetsRemaining = TargetsRemaining - 1;
//		}


		if (TargetRemaining =0){
		function OnGui (){
		GUI.Label (Rect (10, 10, 100, 20)}	
		}

Please Help

var ZombieCyrus : Rigidbody;
var ZombiePatterson : Rigidbody;
var ZombieBeiber : Rigidbody;
var TargetsRemaining : int = 3;

function Start () {
 ZombieCyrus.enabled = true; 
 ZombiePatterson.enabled = true; 
 ZombieBeiber.enabled = true;

}

function Update () {

//if(collision.enabled == true)

} 
function OnCollisionEnter(collision : Collision){ 
if (collision.collider.tag == "ammo")
{ Debug.Log("block detecting collision by"+collision.collider.tag);
 // if the bullet hits the zombies collision detection; 
 Destroy(gameObject); 
 ZombieCyrus.enabled = false; } }

if (ZombieCyrus == false){ 
TargetsRemaining = TargetsRemaining - 1;
 } 
 if (ZombieBeiber == false){ 
  TargetsRemaining = TargetsRemaining - 1;  } 
  if (ZombiePatterson == false){ 
   TargetsRemaining = TargetsRemaining - 1;  }

Okey , so you mistake is → in the if statement you must use == not = , those are not the same thing.And second the, 5th line var OnGui : GuiLabel; doesn’t make any sense.If you want to use GUI , use this :

function OnGUI () {
GUI.Label(Rect(x,y,width,height),"some message"); 
}
  1. You are wrapping a method with a conditional check. Take if (TargetRemaining =0)and place it within the OnGui method. Placing the label within it.

2.Change OnGui to OnGUI

3.Change 1 = to ==

function OnGUI()
{
if(TargetRemaining == 0)
GUI.Label....
}