Why is this script for my developer product not working?
productId = 20008845
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")
MS.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.MouseClick:connect(onClick)
Thank you!

2 comments
it works! Thank you!
No problem.