Wow, thanks for all the help Scripting Helpers.

local buyButton = script.Parent
local productId = 25039259
 
buyButton.MouseButton1Click:connect(function()
	game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, productId)
end)
 
 
local MarketplaceService = game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
local productId = 20518668

MarketplaceService.ProcessReceipt = function(receiptInfo) 

	for i, player in ipairs(game.Players:GetChildren()) do
		if player.userId == receiptInfo.PlayerId then
 

			if receiptInfo.ProductId == productId then
 				player.leaderstats.Money.Value = player.leaderstats.Money.Value + 100
			end
		end
	end	
 
	local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_purchase_" .. receiptInfo.ProductId
	ds:IncrementAsync(playerProductKey, 1)	
 
	return Enum.ProductPurchaseDecision.PurchaseGranted		
end

2 comments

0

Can you fill us in on what exactly your problem is? That might help us solve it

0

Simple, nothing happens, user is not prompted to buy the product.