Hi I just have a tiny little problem. The problem is if the change in player’s health was a increase or decrease. So far from the roblox website, I was able to figure out by how much the player’s health has changed. I just don’t know how to figure out if that change in health was a decrease or increase.
local Currenthealth = Humanoid.Health
Humanoid.HealthChanged:Connect(function(Health)
if Health > Currenthealth then
print("Health Increased")
else
print("Health Decreased")
end
end)
The script I gave is just an example. You will have to update the Current health each time (or it will do the error you said). Try something like
Humanoid.HealthChanged:Connect(function(Health)
if Health > Currenthealth then
print("Health Increased")
else
print("Health Decreased")
end
Currenthealth= Health
end)
local Currenthealth = Humanoid.Health
local StoreHealth = 0
StoreHealth = Currenthealth
Humanoid.HealthChanged:Connect(function(Health)
if Health > StoreHealth then
print("Health Increased")
else
print("Health Decreased")
end
StoreHealth = CurrentHealth
end)