local TS = game:GetService("TweenService")
local Tinfo = TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut)
local DamageBoard = game.ReplicatedStorage.DamageBoard
local Red = Color3.fromRGB(255, 0, 0)
local Green = Color3.fromRGB(95,111,64)
for i, v in pairs(game.Workspace:GetChildren()) do
if v:IsA("Model") then
if v:FindFirstChildWhichIsA("Humanoid") then
local hum = v:FindFirstChildWhichIsA("Humanoid")
local humH = hum.Health
hum.HealthChanged:Connect(function(Health)
if Health < humH and Health > 0 then
local Damage = math.floor(humH - Health)
print(Damage.." Damage was taken")
local BoardClone = DamageBoard:Clone()
BoardClone:FindFirstChild("Damage").Damage = Damage
local maxH = hum.MaxHealth
BoardClone.Damage.TextColor3 = Green:lerp(Red, Damage / maxH)
BoardClone.Parent = v.HumanoidRootPart
BoardClone.Damage:TweenSize(UDim2.new(1,0,1,0), "InOut", "Quint", 0.3)
wait(0.3)
local UIupTween = TS:Create(BoardClone, Tinfo, {StudsOffset = BoardClone.StudsOffset + Vector3.new(0,1,0)})
local textFade = TS:Create(BoardClone.Damage, Tinfo, {TextTransparency = 1})
UIupTween:Play()
textFade:Play()
game:GetService("Debris"):AddItem(BoardClone, 0.5)
end
humH = hum.Health
end)
end
end
end
local TS = game:GetService("TweenService")
local Tinfo = TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut)
local DamageBoard = game.ReplicatedStorage.DamageBoard
local Red = Color3.fromRGB(255, 0, 0)
local Green = Color3.fromRGB(95,111,64)
for i, v in pairs(game.Workspace:GetChildren()) do
if v:IsA("Model") then
if v:FindFirstChildWhichIsA("Humanoid") then
local hum = v:FindFirstChildWhichIsA("Humanoid")
local humH = hum.Health
hum.HealthChanged:Connect(function(Health)
if Health < humH and Health > 0 then
local Damage = (humH - Health)
print(Damage.." Damage was taken")
local function roundNum(Damage)
return tonumber(string.format("%." .. (1 or 0) .. "f", Damage))
end
local BoardClone = DamageBoard:Clone()
BoardClone:FindFirstChild("Damage").Text = roundNum(Damage)
local maxH = hum.MaxHealth
BoardClone.Damage.TextColor3 = Green:lerp(Red, Damage / maxH)
BoardClone.Parent = v.Head
BoardClone.Damage:TweenSize(UDim2.new(1,0,1,0), "InOut", "Quint", 0.15)
local UIupTween = TS:Create(BoardClone, Tinfo, {StudsOffset = BoardClone.StudsOffset + Vector3.new(0,3,0)})
local textFade = TS:Create(BoardClone.Damage, Tinfo, {TextTransparency = 1})
UIupTween:Play()
textFade:Play()
game:GetService("Debris"):AddItem(BoardClone, 0.5)
end
humH = hum.Health
end)
end
end
end
local TS = game:GetService("TweenService")
local Tinfo = TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut)
function roundNumber(num, numDecimalPlaces)
return tonumber(string.format("%." .. (numDecimalPlaces or 0) .. "f", num))
end
local DamageBoard = game.ReplicatedStorage.DamageBoard
local Red = Color3.fromRGB(255, 0, 0)
local Green = Color3.fromRGB(95,111,64)
for i, v in pairs(game.Workspace:GetChildren()) do
if v:IsA("Model") then
if v:FindFirstChildWhichIsA("Humanoid") then
local hum = v:FindFirstChildWhichIsA("Humanoid")
local humH = hum.Health
hum.HealthChanged:Connect(function(Health)
if Health < humH and Health > 0 then
local Damage = roundNumber(humH-Health,1)
print(Damage.." Damage was taken")
local BoardClone = DamageBoard:Clone()
BoardClone:FindFirstChild("Damage").Damage = Damage
local maxH = hum.MaxHealth
BoardClone.Damage.TextColor3 = Green:lerp(Red, Damage / maxH)
BoardClone.Parent = v.HumanoidRootPart
BoardClone.Damage:TweenSize(UDim2.new(1,0,1,0), "InOut", "Quint", 0.3)
wait(0.3)
local UIupTween = TS:Create(BoardClone, Tinfo, {StudsOffset = BoardClone.StudsOffset + Vector3.new(0,1,0)})
local textFade = TS:Create(BoardClone.Damage, Tinfo, {TextTransparency = 1})
UIupTween:Play()
textFade:Play()
game:GetService("Debris"):AddItem(BoardClone, 0.5)
end
humH = hum.Health
end)
end
end
end