Kill player developer product

Hey developers, I’m trying to make a gui that kills a player in the server after you purchase a developer product and type up the username then click the kill button. But currently its just type up player username and click kill button
image
Basically like this but it just kills the player


This is what I have so far:

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)
1 Like

You’re allowing any exploiter to fire it and kill anyone they want to. You aren’t validating any remote requests to kill a player.

In order to securely verify the purchases of Developer Products, you need to use MarketplaceService.ProcessReceipt; my suggestion would be to use attributes on your players in your ProcessReceipt. Then checking on the server if a player has the required attribute in order to fire the remote event, killing their specified target, and then removing that attribute afterwards until the player purchases it again.