So I have a npc that follows you but the script makes it so it just brings your health to a point.
local function onTouch(Touch)
if Touch.Parent:FindFirstChild("Humanoid") ~= nil then
Touch.Parent.Humanoid.Health = 0
end
end
script.Parent.HumanoidRootPart.Touched:Connect(onTouch)
So it would set your health to 0, but I want to make it do say 2 damage on hit. How would I accomplish this?

4 comments
Ask if you need the other script like the following script or animation script in the npc
Touch.Parent.Humanoid.Health = Touch.Parent.Humanoid.Health -10 for example
Touch.Parent.Humanoid.Health = Touch.Parent.Humanoid.Health -10 for example
I would mark this as the answer but you commented it....... It worked though