Highscore not working any Ideas?

Hi All,

I am having trouble with my high score i have a OnGUI2D script and i have added to my Level Manager OnGUI2D.OG2D.CheckHighScore(); before loading each level, its trying to save the high score but going a bit crazy, when the level starts it starts with 750 high score if i gain 210 points and die it changes to 210 but always starts with 750.

Any Ideas?

Below is my level manager script…

using UnityEngine;
using System.Collections;

public class LevelManager : MonoBehaviour {

public LevelManager levelManager;
public int score;
public int currentLevel;
public int Score=30;
int highScore;


private PlayerController player;

// Use this for initialization
void Start () {
	player = FindObjectOfType<PlayerController>();
	if (Application.loadedLevelName == "Level_1") {
		score = 0;
		saveScores();
	} else {
		score = getSavedScores();    
	}  

}

// Update is called once per frame
void Update ()

{  
	OnGUI2D.OG2D.CheckHighScore();
	saveScores();
	changeLevel();
}

public void changeLevel()
{
	if (score == 750 && currentLevel == 1)
	{

		saveScores();
		currentLevel++;
		OnGUI2D.OG2D.CheckHighScore();
		Application.LoadLevel("2");

	}    
	if(Application.loadedLevelName == "Level_2")
	{
		getSavedScores();    
	}

	if (score == 1530 && currentLevel == 2)
	{
		saveScores();
		currentLevel++;
		OnGUI2D.OG2D.CheckHighScore();
		Application.LoadLevel("3");
		
	}    
	if(Application.loadedLevelName == "Level_3")
	{
		getSavedScores();    
	}
	
}
//possible if the save functionality intreacts with this
public void saveScores()
{
	if (score > highScore)
	{
		// setting the score	
		PlayerPrefs.SetInt("HighScore",score);
		
	}
}
public int getSavedScores()
{
	
	int tempScore = PlayerPrefs.GetInt("Score");  
	
	return tempScore;
}


public  int getScore()
{    
	
	
	return score;
}
public void AddPoints(int points)
{
	score += points;
}

void OnGUI()
{
	GUI.Label(new Rect(10,10,100,20),"Score: " + score);
}

void OnTriggerEnter2D(Collider2D other)
{
	if(other.name == "Player")	
	
	{
		OnGUI2D.OG2D.CheckHighScore();
		Application.LoadLevel(0); //this is on death completely restart game
	}

}

}

I’m not sure if this will fix everything but a start might be to change your saveScores method:

if (score > highScore)
 {
      highScore = score; 
      PlayerPrefs.SetInt("HighScore", highScore);
 }

as well as doing something similar for CheckHighScore.