Skip Stage Does Not Work

Hi guys,

What i have here is that this is a free model script and I put in my product id and everything. It prompts up (using local script in startergui), and when I buy it, nothing happens.

--this is a server script in sereverscriptservice

local MarketplaceService = game:GetService("MarketplaceService")
print('marketplaceserverce')

MarketplaceService.ProcessReceipt = function(receiptInfo)
	print('function??')
	local players = game.Players:GetPlayers()
	print('omg players')
	
	local Stage = "Stage"
	print('stage')
	local none = 0
	print('none 0')

	for i=1,#players do
		print('players are recongized')
		if players[i].userId == receiptInfo.PlayerId then
			print('yes')
			if receiptInfo.ProductId == 1590273352 and none == 0 then
				print('abc')
				none = 1
				print('none 1')
				players[i].leaderstats[Stage].Value += 1
				print('PLZ WORK')
				players[i].Character.Humanoid.Health = 0
				none = 0
				print('finished')
			end
		end
	end
	return Enum.ProductPurchaseDecision.PurchaseGranted and print("purchase granted")
end

It only prints 'marketplaceserverce" and I dunno why. I know it has something to do with the function(receptinfo)

1 Like

use the example provided on the docs instead

Processing a receipt is impractical, what you should be using is something like this

game:GetService('MarketplaceService').PromptProductPurchaseFinished:Connect(function(player_id, product_id, purchased)
	--// Do stuff
end)

Whenever a product is purchased within a game this function will fire

1 Like

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