Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Key name is too long?

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

0

Thank you all for your help!

2 answers

✓ Accepted answer

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.

1 comment

1

And what he means by that remove the purchase it is kinda pointless.

This discussion is preserved as it was. New answers, comments, and votes are closed.