Need help with highscore system

hello.
I’ve been working on a small android game for some time but I’ve got a small problem.
I cant figure out how to make the high score system
everytime the player hits a coin, he get’s 10 points. and it’s collected as a variable called levelScore.

I’m trying to make a kind of highscore page that you can acces from the main menu where it shows this

Level-1    120 Points 
level-2    200 Points 
Level-3    630 Points

I will be able to make the menu and all that but I’m unsure on how to save the variable levelScore and then get it later and show it in the high score page
and then also if the player should get a higher score than the old one, to update it.

I hope that made sense, please tell me if you have an idea on how to do this
Thanks for your time.
-Frank

Hi.

Lets say you want to save the points for the first level.
You have a Vareable called levelScore and now you want to save this value.
Here you go:

PlayerPrefs.SetInt("level-1",levelScore);

Now you saved a vareable called level-1 with the value of the levelScore-vareable
to the users PC.

To return this value, type this:

PlayerPrefs.GetInt("level-1")

In order to prevent problems occuring if the user want to se
his Level-1-score bevore he played it, type:

if(PlayerPrefs.HasKey("level-1")){
//I dont know how you want to display the value (3D-Text, print, GUI etc.)
}else{
//display nothing
}

Here you ask first if the value “level-1” exists.

To check if the current levelScore-value is bigger than the
saved level-1 value, type:

if(levelScore>PlayerPrefs.GetInt("level-1")){
PlayerPrefs.SetInt("level-1",levelScore);
}

If there are any kind of missunderstandings, please response.
I hope this will help you. =)