How to make an npc not killable?

I think i didn’t wrote this further:

i meant:

and i said it, if he doesn’t want to use Forcefield, and use something else like a value, he can use some lines i wrote in the original reply.

Why are you doing

Humanoid.Health = math.clamp(newHealth, currentHealth, currentHealth)

instead of

Humanoid.Health = currentHealth

as this gives the same result

1 Like

No reason for it. I might’ve been thinking of something different involving the MaxHealth and unconsciously wrote something more lengthy.

2 Likes

Then write another topic, it is too difficult to explain it in this topic. Then you should tell all the details, otherwise we will never find the cause of it. Do you make a zombie game then I ask you if you have scripted your own weapon or not. If not then show the used script of your weapon (only the main script, we don’t need the rest)

thanks, this worked even after 4 years!