First, you will want to add public float highscore; with your other variables at the top. Then, you will want to change the old code to this in your script. This is a very basic save system, and can easily be modified to fit the needs of the game. The comments in the code explain the script in further detail.
// Initiates before the first frame plays void StartUpdate() { // Loads theIncreases score atif start player is still LoadScore(); } alive // Initiates once per frame voidif Update() { // ChangesisPlayerAlive highscore== totrue) current score if current{ score is higher if (score > highscore) += Time.deltaTime * {scoreMulti; highscorescoreText.text = score;score.ToString("Score: 0"); } // IncreasesChanges highscore to current score if playercurrent isscore stillis alivehigher if (isPlayerAlivescore ==> truehighscore) { score += Time.deltaTime * scoreMulti; highscore = score; scoreText.text = score.ToString("Score: 0");} } } // Saves the score when activated, from button, script, etc. void SaveScore() { PlayerPrefs.SetFloat("score", score); PlayerPrefs.SetFloat("highscore", highscore); PlayerPrefs.Save(); } // loads the score and highscore from the save file when activated, fromif button,there script,are etc.any void LoadScore() { score = PlayerPrefs.GetFloat("score", 0); highscore = PlayerPrefs.GetFloat("highscore", 0); }