is updateAsync good for autosaving and/ or for preventing glitches?
✓ ANSWER ACCEPTED
what is the difference between :UpdateAsync and :SetAsync?
1 answer
✓ Accepted answer
SetAsync is generally prefered if the previously saved value is not important e.g. you're saving the player's position in a world.
UpdateAsync is prefered when the previous value is important e.g. you're adding 10 coins onto the player's Coins stat.
The reason is that UpdateAsync will make sure that the previous value is correct, while GetAsync may return a cached value, meaning that SetAsync would set it based on that cached value rather than the actual value.
This discussion is preserved as it was. New answers, comments, and votes are closed.
