So i have a devproduct script that buys a devproduct
It doubles the points value when you buy it twice or more, like if you buy it three times then the third time you buy it you get 300 points instead of 100
I looked at scripts and they said to add Enum.ProductPurchaseDecision.Granted
but it doesnt work for me
my code
local marketplaceservice = game:GetService("MarketplaceService")
local id100 = 1762467891
local id250 = 1762468506
local id500 = 1762468954
local id1000 = 1762470712
marketplaceservice.ProcessReceipt = function(receiptInfo)
local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
local id = receiptInfo.ProductId
marketplaceservice.PromptProductPurchaseFinished:Connect(function(playe, id, ispurchased)
if id == id100 and ispurchased == true then
player.leaderstats.Points.Value += 100
print(player.Name .. " bought the 100 devproduct")
return Enum.ProductPurchaseDecision.PurchaseGranted
elseif id == id250 and ispurchased == true then
player.leaderstats.Points.Value += 250
print(player.Name .. " bought the 250 devproduct")
return Enum.ProductPurchaseDecision.PurchaseGranted
elseif id == id500 and ispurchased == true then
player.leaderstats.Points.Value += 500
print(player.Name .. " bought the 500 devproduct")
return Enum.ProductPurchaseDecision.PurchaseGranted
elseif id == id1000 and ispurchased == true then
player.leaderstats.Points.Value += 1000
print(player.Name .. " bought the 1000 devproduct")
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end)
end