I need armor working via the health, so far, if humanoid health is above 100 then it is showing it, that part working great. However, when humanoid health drops under the 100 it’s showing you negative health. Which can be seen below on screenshot. Is there anyway how I could put a cap, so it doesnt go below 0 and over than 50 (150)?
local player = script.Parent.Parent.Parent.Parent.Parent
player.Character.Humanoid.HealthChanged:Connect(function()
local hel = player.Character.Humanoid.Health - 100
if hel <= 25 then
script.Parent.Text = math.floor(hel)
else
script.Parent.Text = math.floor(hel)
end
wait()
end)