Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

what is the difference between :UpdateAsync and :SetAsync?

is updateAsync good for autosaving and/ or for preventing glitches?

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.