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

This currency purchase script doesn't work even though it works on another button. Why?

Asked by 4 years ago

I have a button so you can buy currency in my game and I use the same script to buy 500 points as the one to buy 50 points, the 500 points button works, but the 50 points doesn't work at all. The scripts are the exact same, just with the product id and point giver changed. That's it, and it doesn't event get to the part where it prints the text... like, why??? Help please

local mps = game:GetService("MarketplaceService")

mps.ProcessReceipt = function(receiptInfo)
    if receiptInfo.ProductId == 1084562484 then
        print("Epic")
        local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
        player.rep.Value = player.rep.Value + 50
        return Enum.ProductPurchaseDecision.PurchaseGranted
    end
end

And the +500 script:

local mps = game:GetService("MarketplaceService")

mps.ProcessReceipt = function(receiptInfo)
    if receiptInfo.ProductId == 1084562922 then
        print("Epicly")
        local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
        player.rep.Value = player.rep.Value + 500
        return Enum.ProductPurchaseDecision.PurchaseGranted
    end
end

^^ this works, but whenever I try to put to change the 2 values for +50 points it doesn't work. WHY??????

1 answer

Log in to vote
0
Answered by 4 years ago

just used another tutorial it works now

0
i was bouta answer this to xd Patsteaks123 -5 — 4y
0
kind of a weird way to solve it but k sean_thecoolman 189 — 4y
Ad

Answer this question