NPCs not taking damage from gears

Hello There! I’m currently making a game with one of my friends, where you collect different gear and fight against slimes to earn money.
For some strange reason only half of the gear does not damage the slimes. All of the gear works perfectly fine on normal NPCs/Dummies but apparently not on the slimes.
Demonstration

I therefore thought it might have something to do with the slime itself and not the gear. I researched on the Dev Forum and found out that Humanoid:TakeDamage() requires a torso for it to work. I therefore changed the name of the main part of the slime to torso but with nothing changed:

image

I’m stuck and do not know how to fix this. Please help!

If you think :TakeDamage(dmg) is the cause you can test using Humanoid.Health = Humanoid.Health - dmg. If that code makes it work then it is the humanoid:TakeDamage() function.

If that doesn’t work then sprinkle print statements throughout your code to make sure it’s passing any if statements and making it all the way to where damage is dealt.

2 Likes

The instance method :TakeDamage() simply reduces/increases the “Health” property of the “Humanoid” instance it is called on in the same way “Humanoid.Health -= Number” would, it isn’t an issue with the instance method but an issue with the script itself.

It doesn’t always damage the character. In the case of something like a force field it won’t. It most likely was an issue script which is why I included the later part of the answer, but it wasn’t impossible that the function just wasn’t damaging the character.