How Do I Make My Score Add Numbers Instead Of Strings?

I am trying to make a basic scoring system and it is adding strings not numbers. here are my script:

var score = 1; var GUIScore : GUIText;

function OnTriggerEnter( other : Collider ) { if (other.tag == "Coin") { GUIScore.text += score; Destroy(other.gameObject); } }

How do I make it add numbers instead of strings (It starts off at 0 and when I pick a coin up it displays 01 and then 011, etc.)

when you gain score increase a numerical variable score and set it to be the newly displayed text - GUIScore.text = score; // not +=

Try this:

function OnTriggerEnter( other : Collider ) 
{ 
if (other.tag == "Coin") 
{
score++; 
GUIScore.text = score.ToString();
Destroy(other.gameObject); 
} 
}

I hope it helps.