Saving scoreboard values when leaving a world

Hello guys! I'm working on a datapack that needs to save each player's score across multiple sessions of play. However, when I leave or when they leave and rejoin, their scores are reset to 0. Any help would be appreciated!

Continue to help post