So, I made this script where if an NPC touches a player the player loses some health. That part works fine, but I need a way for the NPC’s not to kill each other. Below is my current script.
function onTouched(hit)
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil) then
human.Health = human.Health - 5
end
end
script.Parent.Touched:Connect(onTouched)