Check which tool deducted health from the humanoid

Hello, I’m trying to make a script that detects if which tool deducted health from the humanoid. I used this to detect health deduction:

human:GetPropertyChangedSignal("Health"):Connect(function()
end)

But I don’t know how I’d detect which weapon deducted health from the humanoid. I couldn’t find any solutions, any help would greatly be appreciated!

you could set an attribute to the humanoid and the value be the instance of the tool or damage
example thinggy:

  1. tool does dmg
  2. deal dmg to players health
  3. humanoid:SetAttribute(“toolname”,“total_damage_dealt”)

— could also do: humanoid:SetAttribute(“toolname”,humanoid:GetAttribute(“toolname”) or 0 + “total_damage_dealt”)

I think thats a good solution to your problem