My PlayerPrefs code isnt working

I cant use a function, `public void HighScore()
{

        if(score > PlayerPrefs.SetInt("HighScore", 0))
        {

            PlayerPrefs.SetInt("HighScore", score);

            highTxt.text = score.ToString();

        }


    }

` because i get the error " Assets\Scripts\Score.cs(143,12): error CS0019: Operator ‘>’ cannot be applied to operands of type ‘int’ and ‘void’ " (the score is an interger). How could I make this code work?

Thank you =)

It should be PlayerPrefs.GetInt in your If statement, not SetInt.

  public void HighScore()
    {
        if (score > PlayerPrefs.GetInt("HighScore")
            {
            PlayerPrefs.SetInt("HighScore", score);
           PlayerPrefs.Save();   // also add this. Not necessarily here, but before your player can quit.
            highTxt.text = score.ToString();
        }
    }