So all my npc's run at me but they do damage to eachother aswell killing them before they kill me. How do I fix this. Kill/damage script below.
local debounce = false
local function onTouch(Touch)
if Touch.Parent:FindFirstChild("Humanoid") ~= nil then
if not debounce then
debounce = false
Touch.Parent.Humanoid.Health = Touch.Parent.Humanoid.Health - .15
wait(1)
debounce = false
end
end
end
script.Parent.HumanoidRootPart.Touched:Connect(onTouch)

2 comments
It worked! Thanks! I had to removed the print though because the spam was real
oh thats ok