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

What’s the difference between UpdateAsync or is it better to use SetAsync?

I know that when using data stores you can either use SetAsync or UpdateAsync but is either one better than the other?

2 answers

✓ Accepted answer

There is a previous forum here but I will explain it quickly;

SetAsync() is used for setting the value of a key, in which will overwrite the current existing one and UpdateAsync() is used for retrieving the data from thee key and updating it.

4 comments

0

Good Explanation! Thx!

0

bit more info about this - setasync just overrides data but update async allows you to compare the old data with the new data to make sure it's valid. getasync isn't always the most recent data so it's best to validate your data to avoid dataloss which is why uodateasync is better than setasync. Setasync is good when you need to push the data reguardless of what was in there before such as when yo

0

you're saving the data for the first time. I'll get a link to a post I made about it a few days ago

:UpdateAsync and :SetAsync are kind of the same, but :UpdateAsync is useful when there are multiple places that can update a player's data.

This discussion is preserved as it was. New answers, comments, and votes are closed.