Arcade style top-5 list problems

I have some problems making a top-5 list for the score like on those old arcade machines

It looks like the score keeps on updating for all the array elements with a smaller value instead of only one of them

Am I doing it wrong, or am I on to something

Code used:

static var SCORE = 0;
var CustomGUI : GUISkin;

static var TopScore = [0, 5000, 10000, 50000, 100000, 200000];

//I am using a debug score to test it
var DebugScore = 0;

function Update () {
	System.Array.Sort(TopScore);
}

function OnGUI () {
	GUI.skin = CustomGUI;

	TopScore[0] = DebugScore;

	//Print out the score
	GUI.Label (Rect (10, 10,10000, 10000), "Score: " + SCORE);
	GUI.Label (Rect (10, 25,10000, 10000), "1: " + TopScore[5]);
	GUI.Label (Rect (10, 40,10000, 10000), "2: " + TopScore[4]);
	GUI.Label (Rect (10, 55,10000, 10000), "3: " + TopScore[3]);
	GUI.Label (Rect (10, 70,10000, 10000), "4: " + TopScore[2]);
	GUI.Label (Rect (10, 85,10000, 10000), "5: " + TopScore[1]);
	GUI.Label (Rect (10, 100,10000, 10000), "Debug: " + TopScore[0]);
}

I know it might be obvius what I am doing wrong, but I cant find it, sorry for being a n00b.

Thanks in advance:)

I am not quite sure what you are trying to look for. The code executes as expected. Are you referring to SCORE and
DebugScore variable?

static var SCORE = 0;
var CustomGUI : GUISkin;

static var TopScore = [[COLOR="red"]300000[/COLOR], 5000, 10000, 50000, 100000, 200000];

//I am using a debug score to test it
var DebugScore = 0;

function Update () {
	System.Array.Sort(TopScore);
}

function OnGUI () {
	GUI.skin = CustomGUI;
[B][COLOR="red"]        SCORE = -100;
        DebugScore = -200;[/COLOR][/B]
	TopScore[0] = DebugScore;

	//Print out the score
	GUI.Label (Rect (10, 10,10000, 10000), "Score: " + SCORE);
	GUI.Label (Rect (10, 25,10000, 10000), "1: " + TopScore[5]);
	GUI.Label (Rect (10, 40,10000, 10000), "2: " + TopScore[4]);
	GUI.Label (Rect (10, 55,10000, 10000), "3: " + TopScore[3]);
	GUI.Label (Rect (10, 70,10000, 10000), "4: " + TopScore[2]);
	GUI.Label (Rect (10, 85,10000, 10000), "5: " + TopScore[1]);
	GUI.Label (Rect (10, 100,10000, 10000), "Debug: " + TopScore[0]);
}

or do you want something like this?

static var SCORE = 0;
var CustomGUI : GUISkin;

static var TopScore = [[COLOR="red"]7000[/COLOR], 5000, 10000, 50000, 100000, 200000];

//I am using a debug score to test it
var DebugScore = 0;

function Update () {
	System.Array.Sort(TopScore);
}

function OnGUI () {
	GUI.skin = CustomGUI;
  SCORE = -100;
[COLOR="red"]  //TopScore[0] = DebugScore;
  DebugScore = TopScore[0];[/COLOR]

	//Print out the score
	GUI.Label (Rect (10, 10,10000, 10000), "Score: " + SCORE);
	GUI.Label (Rect (10, 25,10000, 10000), "1: " + TopScore[5]);
	GUI.Label (Rect (10, 40,10000, 10000), "2: " + TopScore[4]);
	GUI.Label (Rect (10, 55,10000, 10000), "3: " + TopScore[3]);
	GUI.Label (Rect (10, 70,10000, 10000), "4: " + TopScore[2]);
	GUI.Label (Rect (10, 85,10000, 10000), "5: " + TopScore[1]);
        [COLOR="red"]GUI.Label (Rect (10, 100,10000, 10000), "6: " + TopScore[0]);
	GUI.Label (Rect (10, 127,10000, 10000), "Debug: " + DebugScore);[/COLOR]
}

or do you mean something like this?

[COLOR="red"]static var SCORE = 1000;[/COLOR]
var CustomGUI : GUISkin;

static var TopScore = [7000, 5000, 10000, 50000, 100000, 200000];

//I am using a debug score to test it
var DebugScore = 0;

function Update () {
[B][COLOR="red"]       //if (isKilled)
         SCORE += 1000;

         TopScore[0] = SCORE;[/COLOR][/B]
	System.Array.Sort(TopScore);
}

function OnGUI () {
	GUI.skin = CustomGUI;

  //TopScore[0] = DebugScore;
  DebugScore = TopScore[0];

	//Print out the score
	GUI.Label (Rect (10, 10,10000, 10000), "Score: " + SCORE);
	GUI.Label (Rect (10, 25,10000, 10000), "1: " + TopScore[5]);
	GUI.Label (Rect (10, 40,10000, 10000), "2: " + TopScore[4]);
	GUI.Label (Rect (10, 55,10000, 10000), "3: " + TopScore[3]);
	GUI.Label (Rect (10, 70,10000, 10000), "4: " + TopScore[2]);
	GUI.Label (Rect (10, 85,10000, 10000), "5: " + TopScore[1]);
       [COLOR="red"] //GUI.Label (Rect (10, 100,10000, 10000), "6: " + TopScore[0]);[/COLOR]
	GUI.Label (Rect (10, 127,10000, 10000), "Debug: " + DebugScore);
}

The debugScore variable is just to test if it is working, wich it refuses to do :cry:

I am trying to make the list work something like this (Image below)
http://www.google.co.uk/imgres?imgurl=http://www.gamesdbase.com/Media/SYSTEM/Arcade/Score/big/Star_Wars_Arcade_-_1993_-_Sega.jpg&imgrefurl=http://www.gamesdbase.com/gamedetail-arcade.star_wars_arcade.1993.sega.shooter.sega.aspx&usg=__hEVQ8uhZL0gJYWTSjnR3CT1URAE=&h=1115&w=1440&sz=148&hl=en&start=0&zoom=1&tbnid=87BW4-waj27HJM:&tbnh=136&tbnw=176&prev=/images%3Fq%3Darcade%2Bscore%26um%3D1%26hl%3Den%26biw%3D1362%26bih%3D559%26tbs%3Disch:1&um=1&itbs=1&iact=hc&vpx=1000&vpy=283&dur=5162&hovh=197&hovw=255&tx=100&ty=152&ei=pNTzTPiaNsTrOf3ggfsJ&oei=pNTzTPiaNsTrOf3ggfsJ&esq=1&page=1&ndsp=21&ved=1t:429,r:19,s:0
or this
http://www.google.co.uk/imgres?imgurl=http://www.twobits.com/images/sabc/hiscore.gif&imgrefurl=http://www.twobits.com/16/&usg=__KnW51tVThWPB7ZkRyASrVHrjfJ4=&h=288&w=224&sz=3&hl=en&start=0&zoom=1&tbnid=J-3QUQ8kVAytlM:&tbnh=131&tbnw=102&prev=/images%3Fq%3Dpacman%2Btop%2Bscore%26um%3D1%26hl%3Den%26sa%3DN%26biw%3D1345%26bih%3D559%26tbs%3Disch:1&um=1&itbs=1&iact=rc&dur=508&ei=IdXzTKLkJ4qDOs3rzYQK&oei=IdXzTKLkJ4qDOs3rzYQK&esq=1&page=1&ndsp=24&ved=1t:429,r:5,s:0&tx=24&ty=41

It should work now by using the script from my last post.