I was dumb so I never used Process Receipt. I granted the product right when they closed the window and if it was purchased. am I still getting the robux?
Is this a scripting question…? If so, it belongs in #help-and-feedback:scripting-support.
I don’t really get what you’re saying and I don’t know what “Process Receipt” is, but if they clicked on the buy button and bought it, then they should’ve gotten it, and you should’ve gotten ROBUX. I don’t know what to say other than this.
1 Like
Yes, you are still getting the Robux. ProcessReciept is used to process stuff like in-game money for Example.
local MarketplaceService = game:GetService("MarketplaceService")
MarketplaceService.ProcessReceipt = function(Receipt)
local Player = game:GetService("Players"):GetPlayerByUserId(Receipt.PlayerId)
if Receipt.ProductId == 0 then -- Have this your Developer Product ID.
Player.leaderstats.Points.Value += 500 -- Do whatever here.
return Enum.ProductPurchaseDecision.PurchaseGranted -- Important to make sure it works
elseif Receipt.ProductId == 0 then -- Always have one script using ProcessReceipt, so use elseif to calculate other purchases
Player.leaderstats.Points.Value += 1000
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
1 Like
ProcessReceipt can be used to check if the player is actually able to purchase a product and give them their promised reward.
For example:
MarketplaceService.ProcessReceipt = function(receiptInfo)
local playerProductKey = receiptInfo.PlayerId .. "_" .. receiptInfo.PurchaseId
local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
if not player then -- Cancel the purchase if the player left while purchasing
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if player.UserId == 764674203 then -- Prevent the user with this id from purchasing products
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if receiptInfo.ProductId == YOUR PRODUCT ID then
-- give money or smth
end
return Enum.ProductPurchaseDecision.PurchaseGranted -- Purchased succesfully
end