So basically its supposed to give you 500 when you purchase it but for some reason it gives you more than that. I think it gives it to you more than once. How do I fix this?
local player =script.Parent.Parent.Parent.Parent.Parent
local MarketplaceService = game:GetService("MarketplaceService")
local buyButton = script.Parent
local productId = 24735683
buyButton.MouseButton1Click:connect(function()
MarketplaceService:PromptProductPurchase(player, productId)
end)
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.PlayerGui.Money.MonV.Value = player.PlayerGui.Money.MonV.Value + 500
end
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
