I know how to get the parents but its not killing a player when they click on that ImageButton
function Clicked(hit) local hum = hit.Parent:FindFirstChild("Humanoid") if hum then hum.Health = 0 end end script.Parent.MouseButton1Down:connect(Clicked)
There isn't a hit for a gui! This needs to be a local script
script.Parent.MouseButton1Down:connect(function() --easier to define it here local hum = game.Players.LocalPlayer.Character:FindFirstChild("Humanoid") if hum then --if humanoid is there then hum.Health = 0 end end)