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

My dev products will give me the tool i buy in studio, but not in game?

Asked by
zqqru 1
2 years ago

I have a gui where you can buy tools, like a grapple hook, a flying cloud, etc, but it will only give me the tools in studio and not in game, am i doing something wrong? script:

local mps = game:GetService("MarketplaceService") local ReplicatedStorage = game:GetService("ReplicatedStorage") local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")

mps.ProcessReceipt = function(receiptInfo) for i, player in pairs(game.Players:GetChildren()) do

    if player.userId == receiptInfo.PlayerId then
        if receiptInfo.ProductId == 1276125695 then
            ReplicatedStorage.GrappleHook:Clone().Parent = player.Backpack
            ReplicatedStorage.GrappleHook:Clone().Parent = player.StarterGear

        end
        if receiptInfo.ProductId == 1276288628 then
            ReplicatedStorage.SwapPotion:Clone().Parent = player.Backpack
            ReplicatedStorage.SwapPotion:Clone().Parent = player.StarterGear
        end
        if receiptInfo.ProductId == 1276303060 then
            ReplicatedStorage.Boombox:Clone().Parent = player.Backpack
            ReplicatedStorage.Boombox:Clone().Parent = player.StarterGear
        end
        if receiptInfo.ProductId == 1276306927 then
            ReplicatedStorage.FlyingCloud:Clone().Parent = player.Backpack
            ReplicatedStorage.FlyingCloud:Clone().Parent = player.StarterGear

        end
        if receiptInfo.ProductId == 1276310545 then
            ReplicatedStorage.Taser:Clone().Parent = player.Backpack
            ReplicatedStorage.Taser:Clone().Parent = player.StarterGear
        end
        if receiptInfo.ProductId == 1276327505 then
                ReplicatedStorage.Doge:Clone().Parent = player.Backpack
                ReplicatedStorage.Doge:Clone().Parent = player.StarterGear

        end

    end
end 

local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_purchase_" .. receiptInfo.ProductId
ds:IncrementAsync(playerProductKey, 1)  

return Enum.ProductPurchaseDecision.PurchaseGranted

end

Answer this question