Kill player gui developer product

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)

image

You need to prompt the purchase, e.g.

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.

1 Like

I’m not sure how to make it a dev product to kill player

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.

In more detail:
https://create.roblox.com/docs/reference/engine/classes/MarketplaceService#PromptProductPurchase
https://create.roblox.com/docs/reference/engine/classes/MarketplaceService#ProcessReceipt

I tried making it so it prompts with a developer product and after you buy it it kills the specified user but it didnt work (sorry im not a scripter)

game.workspace.players.[playername].character.humanoid.health = humanoid.health -1000000

that script doesn’t change anything.

its a hint on how to make it… if you want a finished script, i didnt know that.

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.