Board Thread:Roblox Wiki Talk/@comment-50.138.253.19-20130407215524/@comment-35320132-20180416225246

function onTouch(part)

local humanoid = part.Parent:FindFirstChild("Humanoid")

if (humanoid ~= nil) then -- if a humanoid exists, then

humanoid.Health = 0 -- damage the humanoid

end

end

script.Parent.Touched:connect(onTouch)