ProcessReceipt is not working

  1. What do you want to achieve? The “ProcessReceipt” thing to work correctly.

  2. What is the issue? It is not running the code when the gamepass (not product) is bought

  3. What solutions have you tried so far? I looked it up on the Dev Forum and some people had problems with the thing but not my exact problems.

local mps = game:GetService('MarketplaceService')
mps.ProcessReceipt = function(info)
	local plr = game:WaitForChild('Players'):GetPlayerByUserId(info.PlayerId)
	local plrui = plr:WaitForChild("PlayerGui")
	if info.ProductId == "id" then
		plrui:WaitForChild("guistuff"):WaitForChild("shop_inventory"):WaitForChild("vippurchase").Visible = false
		plrui.guistuff:WaitForChild("thanksforpurchase").Visible = true
	end
	return Enum.ProductPurchaseDecision.PurchaseGranted
end

The code after “if info.ProductId == “id” then” doesn’t seem to be working, anyone know why?

ProcessReceipt can only be used to process when a player buys a Developer Product, you need to use PromptGamePassPurchaseFinished to do something when a person buys a gamepass

1 Like

I will try, sorry for the late response!

1 Like