Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is this not giving me the tool when I purchase it?

Asked by 6 years ago
Edited 6 years ago

It worked once then I guess I broke it and I cannot figure out what I did.


local MarketplaceService = game:GetService("MarketplaceService") local buyButton = game.Workspace.BuyButton.ClickDetector local productId = 113601217 buyButton.MouseClick:connect(function(player) MarketplaceService:PromptProductPurchase(player, productId) end) MarketplaceService.ProcessReceipt = function(receiptInfo) MarketplaceService.ProcessReceipt = function(receiptInfo) for i, player in ipairs(game.Players:GetChildren()) do if player.userId == receiptInfo.PlayerId then if receiptInfo.ProductId==113601217 then game.ReplicatedStorage.Card:Clone().Parent = player.Backpack return Enum.ProductPurchaseDecision.PurchaseGranted end end end end end

Answer this question