I want to save the highscore created in the game and can be seen in the main menu when the player hits the highscore button, can someone help me?
Multiple libraries exist for this purpose. GGScore is an open source library built by GlitchGames which can easily allow you to do this: GlitchGames/GGScore
All the documentation you need is in the main page (README.md) so there isn't really a need for me to explain the code. But it's really easy to use.