Using playerPrefs

I though of making a LevelUp script using playerPrefs for my Networked FPS, so heres my theory for doing this:

EveryKill counts as a point,
and if I reach 50 points I level up (var Level : int;).
PauseMenu has a Save button, so I press it and I SetString(“Experience”).
Then in MainMenu I have a GUI showing level, so I do GetString(“Experience”).

Im not and an expert with playerPrefs, so I though that the AnswersCommunity could help me out with a script.

Well your theory is almost fine. Instead of using Set&Get-String() you need to use Set&GetInt(). You are saving points/killcount after all.

So it would be something like:

    var points:int = 0;
    
    //Loading
    void Start()
    {
       points = PlayerPrefs.GetInt("Experience", 0);  //0 is the default value for when "Experience" has never been set before
    }
    
    //Saving
    OnSaveButtonClicked()
    {
       PlayerPrefs.SetInt("Experience", points);
    }