I've been going at this for around an hour now, and can't get my head around why it won't work. It's a damage script where if the NPC is below 65 health, it plays a hurt animation, as well as shows blood and changes face. However, when I change
if script.Parent.Health <= 65 then
to
if script.Parent.Health >= 65 then
it works perfectly but does above 65 health, but when I change it to <, symbolizing below, the script simply does not function. If you have a fix, PLEASE help me.
local humanoid = script.Parent
local cHealth = humanoid.Health
local animation = script.Parent.Parent.LowHealth
local LA = Instance.new("Animation")
LA.AnimationId = "rbxassetid://5540835623"
local LowHealth = humanoid:LoadAnimation(LA)
if script.Parent.Health <= 65 then
LowHealth:Play()
script.Injured.Parent = script.Parent.Parent.Head
script.Parent.Parent.Head.Normal:Destroy()
script.Parent.Parent.Head.Blood.Enabled = true
script.Parent.Parent.Head.Blood2.Enabled = true
script.Parent.Parent.Head.Blood3.Enabled = true
wait(2)
script.Parent.Parent.Head.Blood.Enabled = false
script.Parent.Parent.Head.Blood2.Enabled = false
script.Parent.Parent.Head.Blood3.Enabled = false
-----------------------------------------------------------------------------
elseif script.Parent.Health <= 45 then
LowHealth:Play()
script.Injured.Parent = script.Parent.Parent.Head
script.Parent.Parent.Head.Normal:Destroy()
end
