I wanted my npc to reach a certain point of health and change his health to a new.

Script:

local humanoid = script.Parent:FindFirstChild("Humanoid")
local healthh = humanoid.Health


if healthh ~= 120 then
	humanoid.MaxHealth = 350
	humanoid.Health = 350
end

2 comments

0

br?

0

~= means not equals. If you want to make it reach a certain health then you need to use healthh <= 120. In addition, you need to wrap all of this in a Humanoid.HealthChanged event.