Help with my combat tag script

Basically, I’m trying to make a combat tag in which if the player is damaged he will get a combat tag until he’s 15 seconds away of receiving damage.

The thing is, this script activates not only when the player gets damaged, but when he heals too. How would I make it so when the player heals this script wouldn’t go through?

use Humanoid:TakeDamage({put function here})

oh my god ur a genious sssssssssss

image

But by doing this I get an error in the output, I’m pretty sure :TakeDamage can’t be used like that

I see that you had a new and old heath what you could do is

local oldhealth = 100

humanoid.HeathChanged:Connect(function(newhealth))
   if newhealth < oldhealth then
      {your code here}
      oldhealth = newhealth
      end
end)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.