Problem on the ProcessReceipt wiki

The ProcessReceipt datastore conditional is throwing an error, halting the entire codeblock.

It’s requiring information to be pulled from a datastore that doesnt exist yet, and if it doesnt exist, it halts the rest of the code which is SUPPOSED to run. You havent set the purchasehistorystore, therefore how can you expect a true value to come out of it?

I made this change in my own code because it wasn’t getting passed this point and I quickly realized the problem.

Here’s a direct link to what i’m referencing: https://developer.roblox.com/en-us/api-reference/callback/MarketplaceService/ProcessReceipt

-- If purchase was recorded, the product was already granted
if success and purchased then
	return Enum.ProductPurchaseDecision.PurchaseGranted
else
		error("Data store error:" .. errorMessage)
end

this if statement should be replaced with this:

if success and purchased then
	return Enum.ProductPurchaseDecision.PurchaseGranted
elseif not success then
	error("Data store error:" .. errorMessage)
end
1 Like

This topic was automatically closed after 1 minute. New replies are no longer allowed.