local player = game.Players.LocalPlayer
local humanoid = player.Character.Humanoid
local currentHp = humanoid.Health
humanoid.HealthChanged:connect(function(health)
print(currentHp)
if health < currentHp then
script.Parent:WaitForChild("RemoteEvent"):FireServer(health)
end
end)
Whenever I use this script the currentHp printed is 100. Is there any way to fix this?

4 comments
if I do that the currentHp will be the humanoid's health after the health change xd
So, if that's not what you want, then what do you want?
^^
like I am doing a rpg game with a defense stat. Each time you are hurt you gain a defense point. I want to do it so you can only fire the event when you are hurt not healed. I am a noob in scripting so I don't know how xd.