fetching a value

I have ten ball hanging in air i have tagged all balls as ball and a cube in ground for on trigger enter .when any ball hit the cube it get destroy.The trigger part is working fine for me. My need is i have to get a numeric value according to the ball get hitted on the cube.for example if ball1 is collided with the cube i want to display numeric 1 in Gui like wise if ball2 got collided i want to display 2 on the guy if ball 10 gui should be numeric 10 like wise.I have attached the collision script on cube placed in ground.

There are a few ways you could go about this. If you have a consistent naming convention, you could split the string after the “ball” and just read the number.

 //given balls' names are "ball1", "ball2" and so fourth.
 //ballCollider is the collider passed into OnTriggerEnter
 var number : String = ballCollider.gameObject.name;
 number = number.Remove(0, 4);
 guiText.text = number;

 //if you want to parse the number...
 var numberInt : int = Int32.Parse(number);
 //now you have an integer representation of it.

or you could add a script to each ball that stores a value:

//BallScript.js
 var value : int;

and then the trigger:

 OnTriggerEnter (ballCollider : Collider) {
      guiText.text = ballCollider.GetComponent.<BallScript>().value.ToString();
 }