I’m trying to use UpdateAsync to update a datastore which the same key/entry can be updated cross server. However, to determine new value, I need more data then just the oldValue like they show in the UpdateAsync documentation page. So instead of something like this:
local success, err = pcall(function()
pointsDataStore:UpdateAsync(playerKey, function(oldValue)
local newValue = oldValue or 0
newValue = newValue + 50
return newValue
end)
end)
I would like to do something like this:
local success, err = pcall(function()
pointsDataStore:UpdateAsync(playerKey, function(oldValue, multiplier)
local newValue = oldValue or 0
newValue = newValue + 50 * multiplier
return newValue
end)
end)
Is that possible?