I've been reading about UpdateAsync(), and I am confused by some of its concepts:
For context im trying to use UpdateAsync for a LimitedRedeemCode system, where I will reduce the number of maxredeem when a player redeem the code [100Redeems Left-> Players Redeems a Code -> 99Redeems Left]
I fear that players in other server can also redeem the code at the same time and not properly reduce the RedeemsLeft and cause much more Redeems that it should have and so I explored a way that can make sure that the RedeemLeft data is properly reduced everytime a player uses the code, and so came across UpdateAsync()
I have red that the UpdateAsync makes sure that the data is not overwritten by running the function passed to it again when another server edited the data
(see photo1 from Roblox Documentation)
But ive also come across a dev forum post that we should add an incremental value everytime we edit the data, and in the case that it does not equal to the current increment we will cancel the set, but I don't see the importance of it as UpdateAsync() makes sure that another server cannot overwrite the data, by running again when the data is changed
(see photo 2 from https://devforum.roblox.com/t/stop-using-setasync-to-save-player-data/276457)
PS: I may have commit some mistakes on my current understanding of how UpdateAsync() works and in my question, My current understading about UpdateAsync() is very surfaced level as theres not much documentation around it. Any help is greatly appreciated. Thank you!