how to make when a player died a developer product pop up on their screen and ask them if they want to purchase it?
local MarketplaceService = game:GetService("MarketplaceService")
local productId = 1234567890
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local humanoid = character.Humanoid or character:WaitForChild("Humanoid")
humanoid.Died:Connect(function()
MarketplaceService:PromptProductPurchase(player, productId)
end)
end)
end)
2 Likes