I am confused how to make Datastores Safely save information. I am wondering how to make sure an error doesn't lose someone all of their Currency even if roblox is erroring really bad.
Should I do;
pcall(function() local DSCurrency = DSplrStats:GetAsync("DSCurrency") if DSCurrency then Stats.UpdateStat(uID,"Currency",DSCurrency) end end)))
or maybe;
coroutine.resume(coroutine.create(pcall(function() local DSCurrency = DSplrStats:GetAsync("DSCurrency") if DSCurrency then Stats.UpdateStat(uID,"Currency",DSCurrency) end end)))
I think the 1st one is ok. Something I've seen people do (and also in this tutorial: http://robloxdev.com/articles/In-Game-Currency-with-Roblox ,in the currency manager module, bottom of the page, line 21) is they're retrying 3 times if pcall doesn't return success.
So I wouldn't bother that much with the 1st variant, as long as you wrap it in pcall and save the data every few minutes, when the player leaves and on server shutdown, it's gonna be fine.