The code detects the player first if its touched it. And then it detects if the name of the hit is the head yet sometimes it kills me when the head isnt touching the killbrick .. Heres the script(its in a function)
function module.waterchecktouch(map)
local water = map:GetChildren()
for i = 1, #water do
if water[i]:FindFirstChild("_iswater") then
water[i].Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if hit.Name == "Head" then
hit.Parent.Humanoid.Health = 0
end
end
end)
end
end
end~~~~~~~~~~~~~~~~~

4 comments
Well, I tried it in Studio and it worked perfectly fine! If it's killing on getting hit when its not the head, the head might have touched it for a milisecond or it won't kill.
Oh ! Alright thanks!
You could use a local script in a part and insert this code
@ksvrkp01 Local script does not work in workspace.