When having leaderstat data that is supposed to be saved, it is common to set the leaderstat value to the loaded data when the player joins, and then save the leaderstat value when the player leaves, however this is in my opinion not very reliable, because if the data load fails, leaving the leaderstat value at 0, it will completely reset the data.
Instead, I am changing the leaderstats and the saved value separately, every time the player loses or gains leaderstat points, it updates the leaderstat value and also changes the saved data. So I am never actually saving what is in the player’s leaderstats.
This way, theoretically, even if the player’s data fails to load, and the leaderstats value is set to 0, the value that’s saved in a datastore will still be right.
Is this a good approach, and what could cause data loss when doing it my way?