so I wanted to make a gui that can kill people by adding their username and clicking on "Kill Em!" Which removes their head which then causes them to die but for some reason, it won't work I dont know what to do and how to fix this, can someone help me please!
local plr = game.Players.
local txt = script.Parent.Parent.Player.Text
function onClick()
Player = plr + txt + ".Character"
Player.Head:Destroy()
end
script.Parent.Parent.Submit.MouseButton1Click:Connect(onClick)

1 comment
Since GUI is local and is different on every single player's screen, you can't access the server from something local. You'll need to learn how FilteringEnabled works.