problem with score counting

hello there Im new in unity and I have a “simple” problem…
all I want here is if the highscore is between 0-40 to show me Scene2, and if the highscore is 41-60 to show me Scene3 and so on…thanks

public class Showresult : MonoBehaviour
{

    public Text highscore;

    void Awake()
    {

        highscore.text = PlayerPrefs.GetFloat("CoinsCollected").ToString();

        if (PlayerPrefs.GetFloat("CoinsCollected") >= 0 && PlayerPrefs.GetFloat("CoinsCollected") <= 40)
            {
            SceneManager.LoadScene(2);
        }
        else if (PlayerPrefs.GetFloat("CoinsCollected") >= 41 && PlayerPrefs.GetFloat("CoinsCollected") <= 60)
        {
            SceneManager.LoadScene(3);
        }
        else if (PlayerPrefs.GetFloat("CoinsCollected") >= 61 && PlayerPrefs.GetFloat("CoinsCollected") <= 200)
        {
            SceneManager.LoadScene(4);
        }
        return;
    }

}

That’s a bit messy but I don’t see anything obviously wrong. What actually happens when you run the code?

It doesnt show me the right scenes… like when its “highscore=50” it still shows me the Scene2 “wrong scene”

Under File → Build Settings, are you including all the right scenes in the right order? Remember that the first scene in the list is actually #0, so #2 would be the third one in the list, #3 would be the fourth one, etc.

You can load scenes by name instead of by number if that’s easier.

yeah everything is alright there its just the code…

ohhh i figured it out my score system wasnt working propertly, and it was getting the old playerprefs… thanks again for your help dude