Why my score system not working?

Hi, can someone answer me, why this is not working for me (it’s score system):

var score1 : GUIText;
 
var myScore : int = 0;
 
function Update () {
 
 
score1.text = "Score: " + myScore;
 
 
}

function OnTriggerEnter (col : Collider) {



if(col.gameObject.tag == "Player") {
 
myScore += 10;
 
 
 
}
 
Destroy(this.gameObject); 
 

 
 
}

You’re destroying the trigger when the player enters it! Remove line 25 (Destroy(this.gameObject):wink: and your code should work.