I tried to do the Developer Product thing, but it didn't work. It just took all my money. Help?


game.Players.PlayerAdded:connect(function(Player)
	local stats = Instance.new('BoolValue', Player)
	stats.Name = 'leaderstats'
	local chronos = Instance.new('IntValue', stats)
	chronos.Name = 'Chronos'
	chronos.Value = 0
send)

local MarketplaceService = game:GetService('MarketplaceService')
local devproductid = 31443492 --50 Chronos

MarketplaceService.ProcessReceipt = function(receiptInfo)
	for i, player in ipairs (game.Players:GetChildren()) do
		if player.userId == receiptInfo.PlayerId then
			if receiptInfo.ProductId == devproductid then
			
				--Give them the Cash
				player.leaderstats.chronos.Value = player.leaderstats.chronos.Value + 50
				
			end
		end
		
	end
	return Enum.ProductPurchaseDecision.PurchaseGranted
	
end
local button = script.Parent
local devproductid = 31443492

button.MouseButton1Click:connect(function()
	game:GetService('MarketplaceService'):PromptProductPurchase(game.Players.LocalPlayer, devproductid)
		
end)

1 comment

0

Wont the second code just grant the purchase no matter what, even if they didnt get the money? shouldent the return be put in the same place?