What do you want to achieve?
Make developer product item spawn one time per purchase.
What is the issue?
The script spawns an item as many times I have clicked the button to purchase.
Example: If I purchase 1 time only 1 appears, if I purchase a 2nd time 2 items appear instead of 1 and then 3 and so on.
**What solutions have you tried so far?**Variations of the code and research.
local MPS = game:GetService("MarketplaceService") local id = 1566979635 Button.MouseClick:Connect(function(Player) MPS:PromptProductPurchase(Player, id) MPS.ProcessReceipt = function(receiptinfo) if receiptinfo.ProductId == id then respawnCube() end end end)