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)