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

Help with a developer product?

Asked by
Mr1Vgy 30
9 years ago

Ok so this script doesn't seem to be working, it doesn't throw me any errors and I can't figure out why. Can anyone see why it doesn't work?

wait(.1)
plr = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent
ms = game:GetService("MarketplaceService")

script.Parent.Text = "Buy $"..script.Parent.plusCash.Value
script.Parent.MouseButton1Click:connect(function()
    ms:PromptProductPurchase(plr, script.Parent.id.Value)
end)

ms.ProcessReceipt = function(ri)
    if ri.ProductId == script.Parent.id.Value then
        if plr.userId == ri.PlayerId then
            plr.leaderstats.Cash.Value = plr.leaderstats.Cash.Value + script.Parent.plusCash.Value
        end
    end
    return Enum.ProductPurchaseDecision.PurchaseGranted
end

Answer this question