local Target = script.Parent function onClick(Brick) local Player = Brick.Parent:findFirstChild("Humanoid") if (Player ~= nil) then Player.Health = Player.Health - 100 end end Target.ClickDetector.MouseClick:connect(onClick)
Use this instead.
local Target = script.Parent function onClick(Brick) local h = Brick.Parent:findFirstChild("Humanoid") if(h~=nil)then h.Health = 0 end end Target.ClickDetector.MouseClick:connect(onClick)
Hex's code had a minor error, he used "FindFirstChild" instead of "findFirstChild" and also you can change the local"h" to whatever you desire.