Count the Score

Hello.

How can I make a GUI Text show my Score, every time I Kill a enemy The Score adds up by 10.

If anyone need a enemy Script

Thanks in Advance!

You need a score variable (probably static), that you increase every time you kill an enemy and then display it on the GUI.

Add this to your enemies:

function OnDestroy() {
    score.score += 10;
}

And then this would be score.js:

static var score : int = 0;

function OnGUI() {
    GUI.Label(Rect(X, Y, width, height), "Score:" + score);
}