In solo mode(not online mode), does pcall return false with :UpdateAsync at all times?
1 | local success, message = pcall (PlayerData:UpdateAsync(key, function (oldValue) |
2 | return Data |
3 | end )) |
This could mess up my datastore system where I forceload any missing data and try to revive the player's data.
It states it's a failure but the data is successfully stored..
You are pcalling the value returned by PlayerData:UpdateAsync, not the function call itself. To correct this, simply create an anonymous function for use by pcall:
1 | local success, message = pcall ( function () |
2 | PlayerData:UpdateAsync(key, function (oldValue) |
3 | return Data |
4 | end ) |
5 | end ) |