Saving and loading gfame data with file i/o

I’m having trouble loading and saving game data. So I created a folder with a text file. When I click the new button I want to make a new text file and print hp and x and y coordinates.