Process receipt not working?

whys this script not working? it prompts the purchase but once purchased it does nothing…

local Players             = game:GetService("Players")
local MarketplaceService  = game:GetService("MarketplaceService")
local ReplicatedStorage   = game:GetService("ReplicatedStorage")

local PRODUCT_ID = 3317388711

script.Parent.Touched:Connect(function(hit)
    local player = Players:GetPlayerFromCharacter(hit.Parent)
    if player and hit.Name == "HumanoidRootPart" then
        MarketplaceService:PromptProductPurchase(player, PRODUCT_ID)
    end
end)

local function processreceipt(receiptInfo)
	print("receipt processing")
    local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
    if not player then
        return Enum.ProductPurchaseDecision.NotProcessedYet
	end
	
	print(receiptInfo.ProductId,PRODUCT_ID)
	
	if receiptInfo.ProductId == PRODUCT_ID then
		print("setting true")
        ReplicatedStorage.Events.GuaranteedSecret.Value = true

        return Enum.ProductPurchaseDecision.PurchaseGranted
    end

    return Enum.ProductPurchaseDecision.NotProcessedYet
end

MarketplaceService.ProcessReceipt = processreceipt

Are you sure you’ve placed only one ProcessReceipt callback throughout all your scripts? That might be the issue.

Oh, was not aware this was something you had to do, thank you for this comment, ill look into it right now.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.