Recently I have been working on my games datastores, and part of that is obviously the saving of data using UpdateAsync. Easy enough, never had issues with it before. For some reason though, it no longer seems to work when wrapped inside of a pcall. Script works perfectly fine if I remove the pcall, but with it, it simply fails to execute the transformation function. Even the example from the roblox wiki does not work for me when I tested it.
The script I am using:
pcall(function()
moneydataStore:UpdateAsync(Key,function(oldData)
local formerData = oldData or {DataId = 0}
if savedata.DataId == savedata.DataId then
return savedata
else
return nil
end
end)
end)
If anyone knows what is behind this issue, please let me know as this is quite frustrating.