Hi i been trying to add a local highscore to display when gameover but dont no how new to unity need help?

Here is the script

//Player Scripts

//Inspector Variable
var tagName 	: String;		//Allow the designer to setup a tag in inspector
var rayDistance : float = 0;	//length of the ray for our raycast
var score		: int = 0;		//Score for our player
var gameTime  	: float = 20;	//Amount of time game will last
var loadWaitTime: float = 3.0;	//Amount of time before next scene
var scoreToWin	: int = 10;		//Amount needed to win game

//Private Variable


//
function Start()
{
	InvokeRepeating("CountDown", 1.0, 1.0);		//Repeat coundown every sec
}

//Update - called every frame
function Update () 
{
	//Use mouse button to select game objects in the scene
	if(Input.GetMouseButtonDown(0))
	{
		var hit : RaycastHit;
		var ray : Ray = Camera.main.ScreenPointToRay(Input.mousePosition);//gets mouse position
		
		if(Physics.Raycast(ray, hit, rayDistance))
		{
			if(hit.transform.tag == tagName)
			{
				var enemyScript = hit.transform.GetComponent(scriptEnemyLevel2);
				enemyScript.numberOfClicks -= 1;
				if(enemyScript.numberOfClicks == 0)
				{
					score += enemyScript.enemyPoint;
				}
			}
			else
			{
				print("This is not an enemy");
			}
		}	
	}	
}

function CountDown ()
{
	if(--gameTime == 0)	//Subtract from gametime & avoid going neg seconds
	{
		CancelInvoke ('CountDown');
		if(score >= scoreToWin)
		{
			Application.LoadLevel("sceneScreenLose");
		}
		
		}
}


//
function OnGUI ()
{
	GUI.Label(Rect(10,10,100,20), "Score: " + score);
	GUI.Label(Rect(10,25,100,35), "Time: " + gameTime);
	 
	
}

Unity has a build in class to store data. Take a look at the PlayerPrefs documentation.

For example: we will save a score if its higher than the current score:

If(PlayerPrefs.GetInt("Highscore") < score)
{
    PlayerPrefs.SetInt("Highscore", score);
}

You can also save floats and strings. For a more detailed PlayerPref class, google PlayerPrefsX, it allows you to save string, int and float arrays, bools and othet stuff.

Be aware that for webplayers, thr data is saved in cookies, and has a limit in bytes. I think its around 1MB, but thats enough to store away enough data. For android or standalone builds I think the size can be whatever you want.