How would I make a high score thing? (it would be on a seperate scene)

So I have a points stystem, but I want to add a high score in the main menu. Right now its in a canvas and text and here’s the scripts, i really need help thanks!

One script that shows how much points go in fo each bullet:

function DeductPoints (DamageAmount : int) {
	GlobalScore.CurrentScore +=10;
}

Script for score popping up in game:

static var CurrentScore : int;
var InternalScore : int;

var ScoreText : GameObject;

function Update () {
	InternalScore = CurrentScore;
	ScoreText.GetComponent.<Text>().text = "" + InternalScore;
}

Hi, Are you saving your score anywhere? What i would i do in your case. In my gameOver condition i will save score in PlayerPrefs. e.g PlayerPrefs.setInt(“highscore”,LastscoreValue); And in MainMenu script
previousScore = PlayerPrefs.getInt(“highScore”);
newHighScore = Mathf.Max(previousScore, GlobalScore.CurrentScore);
//It will return me max value.
then again
PlayerPrefs.setInt(“HighScore”,newHighScore);
//It will update HighScore value with newHighScore.
You can read about playerPrefs here:

I am not sure about the specific code but you should start looking into either Player Prefs (Unity - Scripting API: PlayerPrefs) or maybe some sort of Serialization (Unity - Manual: Script serialization).

Both of these methods store data in a file that you can read and transfer data from any scene and can be made to store the data even if the game/application is closed and opened (Basically perfect for score/game-progress saving)

Player Preferences is the easiest by far to get to grips with but it has downsides, it is stored on the device in a text type file that can be easily manipulated by users to cheat high scores but if your game is standalone with no leader board or online feature this won’t matter. PlayerPrefs uses simple scripts to set, get and look-up variables in an external script. An example here: (https://forum.unity3d.com/threads/example-of-using-player-prefs-to-save-and-get-a-variable.42398/)

Serialization is harder to use because it is not built into Unity as well as PlayerPrefs but can potentially be more flexible.

It’s just a place to start, hope this helps!