You can get the amount of hp changed by simply storing the current hp of a player until it changes and doing some math.
repeat wait() until game.Players.LocalPlayer.Character
local humanoid = game.Players.LocalPlayer.Character.Humanoid
local currentHealth = humanoid.Health
humanoid.HealthChanged:Connect(function(health)
local Difference = math.abs(currentHealth - health)
local DifferencePercentMax = ((Difference/humanoid.MaxHealth)*100)
local DifferencePerecentCurrent = ((Difference/currentHealth)*100)
print(humanoid.Name.. " lost ".. Difference.. " hp!")
print(humanoid.Name.. " lost ".. DifferencePercentMax.. "% of their total hp!")
print(humanoid.Name.. " lost ".. DifferencePerecentCurrent.. "% of their current hp!")
currentHealth = health
end)
1 comment
You can just get the current users health and users MaxHealth