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

Why are people saying don't use setasync for data store?

There were some people saying that if there are more players in my game setasync will basically mess up on me? is that true?

5 comments

0

UpdateAsync considers the previous value while SetAsync does not

0

So I should use UpdateAsync instead of SetAsync

0

it doesn't matter if you're not using a function for updateasync

0

SetAsync will override the existing data completely. And what Vulkarin said as well

0

So if you need to do something with the previous value it can be much easier with UpdateAsync

1 answer

✓ Accepted answer

#Well, what they're saying is (mostly) wrong. I think. Don't quote me on that.


Do what you want to do. You should use SetAsync if you want to completely overwrite the player's information, or if the player's information is nonexistent. Even then, you could make your own artificial UpdateAsync that could work wonders compared to the normal. UpdateAsync updates the previous given value. It's rather different when you think about it. You should always take in consideration what you're using, and the way you're using it. Read up on the topics here.

https://www.robloxdev.com/api-reference/function/GlobalDataStore/SetAsync

https://wiki.roblox.com/index.php?title=API:Class/GlobalDataStore/UpdateAsync

https://scriptinghelpers.org/questions/6534/setasync-or-updateasync

####Any misinformation? Please help a man out by notifyng me in the comments.

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