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)

1 comment
Thank you all for your help!