#Developer Product not working

11 messages · Page 1 of 1 (latest)

celest turret
#

I have a purchaseable one-time bomb developer product thats purchaseable inside of a shop.

When the user clicks to purchase the bomb, It will pop up a purchase popup from roblox, Then after the user finishes the transaction it does not give them the proper tool.

low deltaBOT
#

studio** You are now Level 5! **studio

celest turret
#
local button = script.Parent
local player = game.Players.LocalPlayer
local productId = 1654502122 
local toolName = "The Tsar Bomba"

local MarketplaceService = game:GetService("MarketplaceService")
local ServerStorage = game:GetService("ServerStorage")


local function giveTool()
    local toolClone = ServerStorage:FindFirstChild(toolName):Clone()
    toolClone.Parent = player.Backpack
end


local function promptPurchase()
    local success, errorInfo = pcall(function()
        local purchaseResult = MarketplaceService:PromptProductPurchase(player, productId)
        print("Purchase result: " .. tostring(purchaseResult))
        if purchaseResult == Enum.ProductPurchaseDecision.PurchaseGranted then
            giveTool()
        elseif purchaseResult == nil then
            warn("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
        end
    end)

    if not success then
        warn("Error during purchase: " .. errorInfo)
    end
end

button.MouseButton1Click:Connect(promptPurchase)
#

The issue below:

#

the purchase succeeds but the user is not given the item

thin helm
#
game.MarketPlaceService.ProcessReceipt = function(process)
local plr = game.Players:GetPlayerByUserId(process.PlayerId)
If process.ProductId == "productid" then
Local bomb = game.ServerStorage.Bomb:Clone()
bomb.Parent = plr.Backpack
elseif process.ProductId == your second productid if u want then
print("another dev product")
return Enum.ProductPurchaseDecision.PurchaseGranted
end
#

Return with Enum