Score and high score

By the way I want the highest score ever achieved will be on the main menu until someone else will achieve even a higher score.
Now it shows the score of the last game regardless to the highest score ever achieved.
How can I do that?

Iv tried the example your attached multiple time and still can get any results.
Now I try a differed way, and it’s also not working the logic dictate its should work.
Its just keep show me the last score of the last game.

That’s what the code on your screenshot does.
If the last score is less than the highscore, then display the last score.

You try to compare the text of your text object with the global variable. strings as numbers.
That doesn’t work.

What you want is to compare the value of the scene variable with the value of the global variable.

Right. Also, if the last score is more than the high score still its follow the last game played score.

Still show me the score of the last game played

Variables are case sensitive. “score” ,with a lower case ‘s’ as in the condition is different to “Score” with an upper case ‘s’ as in the action.

[edit]
Also, where are you setting the variable highscore of object highscore? Yo are comparing it, but not setting it. And I’d suggest you change the name of your text object to somethign like highScoreText. It’ll take away the confusion between the object and it’s variable.

1 Like

Yes of course :grin:
you change the text to “Score” where the score of the last game played is saved.
don’t use global variables.
save and load the highscore

1 Like

What Mr men is saying
Object variable score of text object score and scene variable score are totally different things and are not related in any way.

You need to understand that
Global variables / object variables / scene variables are all their own values and have nothing to do with each other, even if they have the same name

1 Like

I don’t understand why you’re not just use Storage to solve this. Two lines of code…

I tried what jack proposed without successes.
Can you upload screenshot of your solution?

Here is a game project to show you how to do it.
https://drive.google.com/file/d/1ApgVcw92P062745y4C9RKy8bUah8fHEY/view?usp=sharing

There are no other solutions, everyone would do it that way.
I think you made a mistake, with variable types or something.
Do you want make my solution and upload your project, here or in private message? Then I look at it.

This is what I’m supposed to see?

Okay when I do it I will upload screenshot.

No,not like that, just go to GDevelop and open the game

Thank you all guys. Its was very helpful.
Its work now.
Now to the next problem :pensive: