Help about combo score

I’ve been struggling with this for an hour or more, basically I’ve been making this 2D game where you only jump up on platforms that are generated and score is being updated by taking player’s Y position. Then I figured to make combo system and I did but there’s one thing that’s mind-boggling me for a while now. Combo works perfectly however once I loose my combo streak and jump up again my score resets back to player’s Y coordinate and thats not what I want since combo is pretty worthless rn.

Here’s an image of my score script just to give you guys bit more info:
154740-comboscore.png

Looks like you are only showing the score on the UI as long as your current score is higer then the one you saved in the PlayerPrefs.
I guess you only need an else-case, where you show the score from the PlayerPrefs in the other case

if(PlayerPrefs.GetInt("Score") < score){
    scoreText.text = score.ToString("0");
}
else{
    scoreText.text = PlayerPrefs.GetInt("Score").ToString("0");
}

That’s not the problem my score text works perfectly fine.
Issue is this:

  1. Let’s say I have score of 500 and my
    combo x2 gets activated so now my
    score won’t increase by 10 it will
    increase by 20 since i have combo
    multiplier applied.
  2. Then my combo expires and returns back to x1 and since I’m using player.position.y to update player’s score it will loose all points earned by combo.

Let’s see if I can simplify it even more:
Score works like this: Player.position.y * 10 (so every 1 coordinate player jumps up he gets 10 score)
So lets say I have 500 score and my combo activates, now when player jumps 1 coordinate up he’ll get 20 score and that WORKS FINE! Problem is when combo expires it doesn’t save the score I had instead it just gets player.position.y again…

Example: I had 3000 score with combo then i lost the combo and my score went back to 700 because player is on Y position 70 so 70 * 10 = 700.