#Developer Product not working
11 messages · Page 1 of 1 (latest)
** You are now Level 5! **
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
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