local mps = game:GetService("MarketplaceService")
function getPlayerFromId(id)
for _,v in pairs(game.Players:GetPlayers()) do
if v.UserId == id then
return v
end
end
end
mps.ProcessReceipt = function(receiptInfo)
local productId = receiptInfo.ProductId
local playerId = receiptInfo.PlayerId
local player = getPlayerFromId(playerId)
local productName
if productId == 1004818393 then
local guns = game.ServerStorage.RandomWeapons:GetChildren()
local chosenGun = guns[math.random(1, #guns)]:Clone()
chosenGun = player.Backpack
end
end
I've never been a good person with devproducts, but now if i give this tool, it exponentially multiplys.
No idea how to fix it TBH.
script.Parent.ClickDetector.MouseClick:Connect(function(clicker)
local mps = game:GetService("MarketplaceService")
local player = game.Players:FindFirstChild(clicker.Name)
mps:PromptProductPurchase(player, 1004818393)
end)

1 comment
btw it keeps going like n * n + n, by the third buy you have six tools.