I have some dev products in my game, on purchasing you should get the gear but it seems to not work sometimes. It shows the purchase succeded but doesn’t actually give the gear.
DevProduct Script (ServerScriptService):
local mpService = game:getService("MarketplaceService")
wait(5)
mpService.ProcessReceipt = function(purchaseInfo)
local plr = game:getService("Players"):GetPlayerByUserId(purchaseInfo.PlayerId)
if purchaseInfo.ProductId == 460093218 then -- first product id
game.ServerStorage.GreenBalloon :Clone().Parent = plr.Backpack -- give the item to them
elseif purchaseInfo.ProductId == 454518973 then -- second product id
game.ServerStorage.FlyingCarpet :Clone().Parent = plr.Backpack
elseif purchaseInfo.ProductId == 454518001 then -- third product id
game.ServerStorage.GravityCoil :Clone().Parent = plr.Backpack
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
Gear Button Script:
local productId = 454518001 -- Change to the ID of your developer product.
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
end)
It’d be great if someone could help me out to fix this.