I currently have a script set up to Update players data while checking Version IDs to prevent any incidents of potentially outdated data being saved.
function SaveMoney(plr,Data)
if Data then
local success,err = pcall(function()
local Key = "Money_"..plr.UserId
print("Save Function Called") -- To show it does indeed reach this point.
moneydataStore:UpdateAsync(Key, function(oldData)
print("Saving Data") -- Does not ever get printed.
local formerdata = oldData or {DataId = 0}
print(formerdata)
if Data.DataId == formerdata.DataId then
local newData = Data
return newData
else
return nil -- Cancels the save if the data is outdated
end
end)
end)
print(success,err) -- Does not ever print an output of the pcall.
end
end
However, it never gets through the pcall, it seems to get stuck in an infinite yield. It never even does the print immediately after the UpdateAsync is called. I would appreciate any help in understanding what is behind this issue.
Update: It appears to be the issue is related to the pcall, as removing it fixes the issue. However, you are always supposed to wrap UpdateAsync in a pcall, so I can't really do that.

1 comment
This did not fix the issue, it still does not run the transformation issue. As long as a pcall is involved, the transformation function does not execute.