scoreboard problems

im trying to create a scoreboard but i got a lot of error here is my code

function Update () {

function OnControllerColliderHit(hit  : ControllerColliderHit);

var score : GameObject; 
if(myCollision.gameObject.name == "fruit")

     score.GetComponent("Score").AddToScore(); 
     Destroy (gameObject); 
  }

i want when my player hit the gameodject fruit get one point but i got error

Remove the semi-colon at the end of the line containing OnControllerColliderHit.

Where is myCollision getting initialized?

EDIT: And what is Update doing on top of the code?

EDIT2: I’m lost. Is that 2 functions mashed up together? XD

You need to use OnCollisionEnter() in conjunction with GameObject.Tag and, presumably, some GUI shenanigans. I’m not going to write your code for you (and I don’t necessarily speak for everyone here) but I will help you if you have specific questions about things and are willing to put some effort in.

You won’t understand what your code does until you try to learn it.

thankyou very muchhhhhhhhhhhh lol i fixed it look at my code

var score : GameObject;

function OnControllerColliderHit(hit : ControllerColliderHit)
{

if(hit.gameObject.tag == “Floor”)

 score.GetComponent("Score").AddToScore(); 

}

but know i want to know how to create a function Kill () that when my player hit the floor disappear.