I'm not sure if anyone here is familiar with the Health Glitch, but basically it's when someone takes damage but then regains the health that they lot instantaneously due to lag or other reasons.
I am making a gun script, and I want to know how to fix that.
I have already tried distributing damage in these ways:
humanoid:TakeDamage(damage)
humanoid.Health = Humanoid.Health - damage
Both these methods result in health glitching. Does anyone know how to fix?

3 comments
if you are trying to damage an enemy from a local script in a player, you can not have filtering enabled.
There's no Filtering Enabled on
Try using a ServerScript. I would recommend using the :TakeDamage method to prevent people from being damaged with Froce Fields on them.