Playerprefs unexpected

Hello everyone
So this is the case:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class score : MonoBehaviour {

    public float Score = 0.0f;

    private int difficultyLevel = 1;
    private int maxDifficultyLevel = 10;
    private int scoreToNextLevel = 10;

    private bool isDead = false;

    public Deathmenu deathMenu;

    public Text scoreText;


    // Use this for initialization
    void Start () {
       
    }
   
    // Update is called once per frame
    void Update () {


        if (isDead)
            return;

        if (Score >= scoreToNextLevel)
            LevelUp ();

        Score += Time.deltaTime * difficultyLevel;
        scoreText.text = ((int)Score).ToString ();
       
    }

    void LevelUp()
    {
        if (difficultyLevel == maxDifficultyLevel)
            return;
        scoreToNextLevel *= 2;
        difficultyLevel++;

        GetComponent<playermotor>().SetSpeed (difficultyLevel);
    }

    public void OnDeath()
    {
        isDead = true;

        deathMenu.ToggleEndMenu (Score);
        if(PlayerPrefs.GetFloat("Highscore" < score)
            PlayerPrefs.SetFloat("Highscore", score);
    }


}

for some reason in the OnDeath section :

PlayerPrefs.SetFloat(“Highscore”, score);

Is not working.

I think rather this is the line that doesn’t work:

if(PlayerPrefs.GetFloat("Highscore" < score)

Try:

if (PlayerPrefs.GetFloat("Highscore") < score)

Your getFloat looks wrong.

@Kwinten beat me to it. I’m surprised your current setup compiled honestly.

@Kwinten This is not working im getting 4 error messgaes now:

Assets/scripts/score.cs(55,43): error CS0119: Expression denotes a type', where a variable’, value' or method group’ was expected

Assets/scripts/score.cs(55,43): error CS0118: score' is a type’ but a `variable’ was expected

Assets/scripts/score.cs(56,38): error CS0119: Expression denotes a type', where a variable’, value' or method group’ was expected

Assets/scripts/score.cs(56,38): error CS0118: score' is a type’ but a `variable’ was expected

Your score is lowercase, which is trying to target your class. Change it to your Uppercase Score variable.

Both your playerprefs should use Score, not score.

For future reference, classes are usually capitalized and fields usually start with a lowercase.

Thanks @Brathnann