Below, you'll find a portion of my script. When I went to test it in-game, it gave me the error 'key name too long'. Any tips? (Yes, this is for Dev products)
MarketplaceService.ProcessReceipt = function(receiptInfo) -- find the player based on the PlayerId in receiptInfo if p.userId == receiptInfo.PlayerId then -- check which product was purchased if receiptInfo.ProductId == id then n = p.Name end end -- record the transaction in a Data Store local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_purchase_" .. receiptInfo.PurchaseId ds:IncrementAsync(playerProductKey, 1) --error is here -- tell ROBLOX that we have successfully handled the transaction return Enum.ProductPurchaseDecision.PurchaseGranted end end end)
According to the wiki:
Combined, the key and value of an entry in the data store cannot exceed 64 kilobytes, or 2^16 characters.
It literally means the key is too long. Just shorten the name of the key.