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