Hi guys! I have a developer product. When you click on the textbutton it displays the roblox buy it now button, but for some reason it always fails. Any ideas?
--LocalScript in textbutton (in screengui)
local buyButton = script.Parent local productId = 22343504 buyButton.MouseButton1Click:connect(function() Game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, productId) end)
--Script in Workspace (Or can it be somewhere else?)
local MarketplaceService = Game:GetService("MarketplaceService") local productId = 22343504 MarketplaceService.ProcessReceipt = function(receiptInfo) for i, player in ipairs(game.Players:GetChildren()) do if player.userId == receiptInfo.PlayerId then if receiptInfo.ProductId == productId then player.leaderstats.Money.Value = player.leaderstats.Money.Value + 5 end end end return Enum.ProductPurchaseDecision.PurchaseGranted end