Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Key name is too long?

Asked by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
10 years ago

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)

0
Thank you all for your help! Shawnyg 4330 — 10y

2 answers

Log in to vote
1
Answered by 10 years ago

According to the wiki:

Combined, the key and value of an entry in the data store cannot exceed 64 kilobytes, or 2^16 characters.

Ad
Log in to vote
0
Answered by 10 years ago

It literally means the key is too long. Just shorten the name of the key.

1
And what he means by that remove the _purchase_ it is kinda pointless. fireboltofdeath 635 — 10y

Answer this question