You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear! I want to know why this error is happing.
What is the issue? The code errors for some reason: Argument 3 missing or nil
What solutions have you tried so far? Did you look for solutions on the Developer Hub? I don’t know
I just want to get this error resolved asap!
local UMS = game:GetService("MemoryStoreService")
local map = UMS:GetSortedMap("ServersBrowser")
function PlaceBid(itemKey, bidAmount)
map:UpdateAsync(itemKey, function (item)
item = item or { highestBid = 0 }
if item.highestBid < bidAmount then
item.highestBid = bidAmount
return item
end
return nil
end)
end
PlaceBid(1, 5000)
MemoryStoreSortedMap:UpdateAsync(string key , Function transformFunction , int64 expiration)
The third argument/parameter for the method you are using determines the expiration date for the specific key which are in seconds.
local UMS = game:GetService("MemoryStoreService")
local map = UMS:GetSortedMap("ServersBrowser")
function PlaceBid(itemKey, bidAmount)
map:UpdateAsync(itemKey, function (item)
item = item or { highestBid = 0 }
if item.highestBid < bidAmount then
item.highestBid = bidAmount
return item
end
return nil
end, 100) --> For instance, the data we updated would expire after 100 seconds unless we update it once again. You can modify the number, but it must be an integer
end
PlaceBid(1, 5000)