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

So I have this developer product script and it won't work for some reason, anyone know why? It doesn't throw any errors...

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

0
Make sure it is NOT in a `LocalScript` Moxeh 84 — 9y
0
Nope, if it was a LocalScript, I'd use game.Players.LocalPlayer Mr1Vgy 30 — 9y
0
Try specifying the ProcessReceipt before your MouseButton1Down event.. I can't see anything else that could potentially make this not work Goulstem 8144 — 9y

Answer this question