How to save my integer from one variable to another?

Ive been trying to make the number of pickups save to a file and i’m not sure what i’m doing wrong. So what i have done is: I have the Dtotalnumberofpickups variable adding 100 for every pickup i get and that is binded to a widget i made to show the score when playing the game and that works fine. Also the number of lives variable adds fine as well for every 10 pickups i get. I thought the Dnumberof pickups variable would get the number of pickups and put it into my SNumberofpickups variable and save but that is not working. I appreciate the help. Thanks.