Kill player gui

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.

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

Instead of making it via a remote (possible that exploiters could abuse this by firing remotes), you should try to make this with a ProcessReceipt considering it’s a developer product. Below you can find some ProcessReceipt stuff!

https://developer.roblox.com/en-us/api-reference/callback/MarketplaceService/ProcessReceipt

Sorry, I’m not sure how to do so.

The wiki has a very nice tutorial on how to incorporate developer products if you would like to know more on how to use them.