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

2 Dev Products don't work, only the clone does, not the orignal. Help?

Asked by 6 years ago

Okay, so I have 2 dev products and only 1 works. When I test buy the first 1 it doesn't work, while the 2nd one does. I copied the second one from the 1st one, and now the 1st one doesn't work. The 1st one is supposed to give a number value +100 and update a text label. The second does the same but does +1000. Help?

Dev Product 1 in Button (Not Working)

local MarketplaceService = game:GetService("MarketplaceService")
local Button = script.Parent
local productId = 185130788

Button.MouseButton1Click:connect(function()
    MarketplaceService:PromptProductPurchase(game.Players.LocalPlayer, productId)
end)

Dev Product 1 in Server Script Storage (Not Working)

local Marketplace = game:GetService('MarketplaceService')
local devproduct = 185130788

Marketplace.ProcessReceipt = function(receiptInfo)
    for i, player in ipairs(game.Players:GetChildren()) do
        if player.userId == receiptInfo.PlayerId then
            if receiptInfo.ProductId == devproduct then
                game.Workspace.Clicks.Value = game.Workspace.Clicks.Value + 100
                wait (.11)
                game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.TextLabel.Text =("Clicks : ".. game.Workspace.Clicks.Value)
            end
        end
    end
    return Enum.ProductPurchaseDecision.PurchaseGranted
end

Dev Product 2 in Button (Working)

local MarketplaceService = game:GetService("MarketplaceService")
local Button = script.Parent
local productId = 185154428

Button.MouseButton1Click:connect(function()
    MarketplaceService:PromptProductPurchase(game.Players.LocalPlayer, productId)
end)

Dev Product 2 in Server Script Storage (Working)

local Marketplace = game:GetService('MarketplaceService')
local devproduct = 185154428

Marketplace.ProcessReceipt = function(receiptInfo)
    for i, player in ipairs(game.Players:GetChildren()) do
        if player.userId == receiptInfo.PlayerId then
            if receiptInfo.ProductId == devproduct then
                game.Workspace.Clicks.Value = game.Workspace.Clicks.Value + 1000
                wait (.1)
                game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.TextLabel.Text = ("Clicks : ".. game.Workspace.Clicks.Value)
            end
        end
    end
    return Enum.ProductPurchaseDecision.PurchaseGranted
end

If anyone could find a solution to this, it would be greatly appreciated. Thanks!

-Doglover9190

Answer this question