Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[Solved] Why does the third paragraph only work in my purchase system script??

Asked by 2 years ago
Edited 2 years ago

HI, I am making a buy money product purchase system. I got the buttons for it to work no problem. But the script that gives the money doesn't really work. What happens is none of it works except for the third paragraph. Sounds weird, but true only the third paragraph only works. I even switched the first and third paragraph and still only the third paragraph works. Script: also script is in serverscriptservice

local MPS = game:GetService("MarketplaceService")



MPS.ProcessReceipt = function(receiptInfo)

    if receiptInfo.ProductId == 1333295011 then

        local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)

        player.leaderstats.Money.Value = player.leaderstats.Money.Value + 1500

        return Enum.ProductPurchaseDecision.PurchaseGranted

    end

end



MPS.ProcessReceipt = function(receiptInfo)

    if receiptInfo.ProductId == 1333302758 then

        local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)

        player.leaderstats.Money.Value = player.leaderstats.Money.Value + 35000

        return Enum.ProductPurchaseDecision.PurchaseGranted

    end

end


--this paraghraph under this works very weird!!
MPS.ProcessReceipt = function(receiptInfo)

    if receiptInfo.ProductId == 1333302500 then

        local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)

        player.leaderstats.Money.Value = player.leaderstats.Money.Value + 7500

        return Enum.ProductPurchaseDecision.PurchaseGranted

    end

end

not getting any errors either. Also I have tried moving things around in script and making three separate scripts and only one of them work!! Also I even tried putting the script in workspace

1 answer

Log in to vote
0
Answered by 2 years ago

Solved the issue I needed to add the else commands in there

Ad

Answer this question