so i tried making a script that detects when the player's health decreases, but i kept getting "attempt to compare number < boolean". i'm pretty sure the boolean value is "newHealth", but how can that be a boolean value? here's the code (it's a local script, in StarterCharacterScripts)
local char = script.Parent
local hum = char:FindFirstChild("Humanoid")
local oldHealth = hum.Health
hum.HealthChanged:Connect(function(newHealth)
if math.abs(oldHealth - newHealth) <= 10 > 1 then
--code
end
end)
thanks in advance

1 comment
The moment I realized I blooped up.