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