I am making a mobile game and I want to know how to save the variable so that whenever someone opens up the game on their phone the high score will still be there
Develop games in your browser. Powerful, performant & highly capable.
See if this tutorial helps you:
How are you compiling the mobile app with CJS or XDK?
If it is just a single value you want to save, the web storage plugin works in CJS / XDK and is very easy to use.
See attached CAPX.
I don't want to save it online. It's a number, a high score, that I would like to be saved in the game/phone.