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

Developer Product Script not working?

Asked by 10 years ago

So, I am creating a game, sorta like Cookie Clicker. This is a script I used for buying clicks with developer products. I don't know if it's the problem or not, but I am not BC

Since I can't load developer products in test, I can't figure out what the problem is. Please tell me what the problem is and fix my mistake.

local productId = 22069922
local player = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent

script.Parent.MouseButton1Click:connect(function()
    game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
end)

MarketplaceService.ProcessReceipt = function(receiptInfo) 
    for i, player in ipairs(game.Players:GetChildren()) do
        if player.userId == receiptInfo.PlayerId then
            if receiptInfo.ProductId == productId then
                player.leaderstats.Clicks.Value = player.leaderstats.Clicks.Value + 500
            end
        end
    end

2 answers

Log in to vote
0
Answered by 10 years ago

What does the output say? (sorry this is meant to be a comment but I'm stupid and couldn't find the comment button (It doesn't allow you to do it for the asker))

0
"Since I can't load developer products in test, I can't figure out what the problem is. " Grenaderade 525 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

Looking at that error message, maybe you should try to run the place as a server, and check if it works outside of the studio testing mode.

Answer this question