I’m not a bum, I promise.
Shouldnt the if success and purchased thing, not be an else statement, but an elseif not success then?
Otherwise it’s requiring information that doesnt exist yet. 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 everything now works smoothly, just wanna make sure I won’t have issues.
Here’s a direct link to what i’m referencing: https://developer.roblox.com/en-us/api-reference/callback/MarketplaceService/ProcessReceipt
local playerProductKey = receiptInfo.PlayerId .. "_" .. receiptInfo.PurchaseId
local purchased = false
local success, errorMessage = pcall(function()
purchased = purchaseHistoryStore:GetAsync(playerProductKey)
end)
-- 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