Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 5 years ago

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

0
UpdateAsync considers the previous value while SetAsync does not Vulkarin 581 — 5y
0
So I should use UpdateAsync instead of SetAsync User#22788 5 — 5y
0
it doesn't matter if you're not using a function for updateasync User#22604 1 — 5y
0
SetAsync will override the existing data completely. And what Vulkarin said as well User#19524 175 — 5y
0
So if you need to do something with the previous value it can be much easier with UpdateAsync User#19524 175 — 5y

1 answer

Log in to vote
0
Answered by
Fifkee 2017 Community Moderator Moderation Voter
5 years ago

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.

Ad

Answer this question