Player stats problem.

Hi, i have a problem with save player stats in html5 games.
I export my game to apk and save variable as file not working.

I need to save player stats (like fuel, stars) in my mobile phone files. How i Can do this?

Assuming you are using the storage actions, In HTML5 the storage action is using web storage so there will be no files created but everything saved in your browser.
Regarding the apk I’m not sure… In case you are trying the native apk export, I believe storage action doesn’t work there but I can be wrong I’m not sure about that.

But if I restart my app, all global Variable what I create is restart to default value (0)
Can i change this?

Global variables are stored in memory only as long the game is running, If you close the game the variables are wiped from the memory.
You need to use storage actions to Read and Write values and store them even after the game is closed.
If you don’t know how to use the storage actions, you can find an example included with GDevelop called “Basic Level Editor” you can also find some more on the wiki.

EDIT://
In case you mean you are trying to read the values in to the global variables, I believe that is not possible. You need to read the values in to scene variables, in case you want to store any of them in a global variable after read the value in to scene you can pass the value to global.

Thanks for your help. :smiley: