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

Why is my Developer Product script not working?

Asked by 10 years ago

Why is this Developer Product script not prompting the player with the Buy prompt? Code: productId = 20008845 Brick = script.Parent

function onClick(Clicker) Player = game.Players:GetPlayerFromCharacter(Clicker.Parent) game:GetService("MarketplaceService"):PromptProductPurchase(Player, ProductId) end MS = game:GetService("MarketplaceService") PH = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory") MB.ProcessReceipt = function(RI) for i, player in ipairs(game.Players:GetChildren()) do if player.UserId == RI.PlayerId then if RI.ProductId == ProductId then player.Character.Health = 0 end end end playerProductKey = "player_" .. RI.PlayerId .. "purchased" .. RI.PurchaseId PurchaseHistory.IncrementAsync(playerProductKey, 1) return Enum.ProductPurchaseDecision.PurchaseGranted end

script.Parent.Touched:connect(onClick)

Answer this question