Hello there, I am trying to make it so that when you click a kill button you can kill a specific user in the server by purchasing a developer product. But currently Its just click button to kill player without purchasing a developer product.
local remote = game.ReplicatedStorage.KillPlayerRemote
remote.OnServerEvent:Connect(function(player, playerUserName)
game:GetService("Players"):WaitForChild(playerUserName).Character.Humanoid.Health = 0
end)
local remote = game.ReplicatedStorage.KillPlayerRemote
local plrToKill = script.Parent.Parent.PlayerToKill
script.Parent.MouseButton1Click:Connect(function()
remote:FireServer(plrToKill.Text)
end)
local MarketplaceService = game:GetService("MarketplaceService")
MarketplaceService:PromptProductPurchase(player, productId) -- change these to whatever suits your use case
You can then handle the purchase using the ProcessReceipt callback.
When the player clicks the “Kill” button, prompt the purchase. You can then add the ProcessReceipt callback separately which will be used to validate the purchase → if successful then kill the target player.
Im trying to make it so that when you type in the username in the box and click kill it pops up with a developer product prompt and only after you but it you can kill that person, but currently I dont have the developer product prompt.