How to save High Scores

Hey guys Im stumped on how to save high scores. After my player gets killed and he has the highest score I want his score to be saved. I know I use PlayerPref class but im not sure how to use this.

static var score = 0; //current score
var totalScore = 0; //combined total of players score
var highscore = 0; //highest score player has gotten

var scoretext : GUIText;
var money : AudioClip;

function Update()

	scoretext.text = score + ""; //display score
	if(score > highscore && TurnGameOver.dead2 == true) //when player dies set highscore = to that score
		highscore = score;
		PlayerPrefs.SetInt("High Score", highscore);
		Debug.Log("High Score is " + highscore );


function OnTriggerEnter(other : Collider)
 	//add to players score if he collects a gem
	if( == "GreenGem" || == "BlueGem" || == "RedGem" || == "GreenGem(Clone)" || == "BlueGem(Clone)" || == "RedGem(Clone)")
		score += 10;
		Debug.Log("Your score is " + score);
		Destroy(other.gameObject); //Destroys Gem after player collects it


you want to save the high score so it still shows up after closing and relaunching the game, yes? you have done the first part right, saving the score… but in order to have it show up next time, you need to retrieve it first… use the Start function:

function Start(){
highscore = PlayerPrefs.GetInt("High Score");

simple as that!