Need help with this script, storing a high score

I am new to scripting, really need some help with using playerprefs

Here is my script

using UnityEngine;
using System.Collections;

public class Score : MonoBehaviour {
    public GUIText countText;
    public GUIText endText;
    public int score;
    public int highscore;

    void Start()
    {
    endText.text = "";
    countText.text = "Score";
  

    }

    void OnTriggerEnter(Collider other)
    {
                if (other.gameObject.tag == "PickUp") {
                        score = score + 1;
                        SetCountText ();
                }

                if (other.gameObject.name == "Pick Up2") {
                        score = score + 4;
                        SetCountText ();
                }

                if (other.gameObject.name == "Pick Up3") {
                        score = score + 9;
                        SetCountText ();
                }

                if (other.gameObject.name == "Pick Up4") {
                        score = score + 19;
                        SetCountText ();
                }

                if (other.gameObject.tag == "Player") {
                        endText.text = "Final Score " + score.ToString ();      
                }

                              
        }



    void SetCountText()
    {
        countText.text = "Score " + score.ToString();
    }

    void Gameover()
    {

                if (score > PlayerPrefs.GetInt ("score"))
        {
            PlayerPrefs.SetInt ("score", highscore);
        }

    }


    void OnGUI ()
        {
              
            {
                GUI.Label (new Rect(300, 0, 100, 50),"High Score " + highscore);
            }
      
            {
                if (GUILayout.Button("Restart", GUILayout.Height(50), GUILayout.Width(100)))
                      
                Application.LoadLevel (1);
            }

          
      
        }

}

once again, you need to get the high score from playerprefs before you display it in the gui…

you’ve also introduced a mistake on line 57; you should be checking if score is higher than “highscore” rather than “score”

Ok I understand but how do I save the final score which comes from this code on trigger to a playerpref

endText.text = "Final Score " + score.ToString ();