-- Settings local DAMAGE_COLOR = Color3.fromRGB(255, 75, 75) local DEATH_COLOR = Color3.fromRGB(255, 0, 0) local HEAVY_HIT_THRESHOLD = 50 local STACK_RESET_TIME = 5.0 -- Time before the total damage resets to 0 local DISPLAY_TIME = 1.3 -- Time the number takes to float and fade local BASE_SHAKE = 0.12 local BASE_SIZE = 2.2 local ActiveIndicators = {} -- Tracks the single active UI per humanoid local function formatDamage(amount) local absAmount = math.abs(amount) -- Custom Smart Decimals logic if absAmount % 1 == 0 then return tostring(math.floor(absAmount)) else return string.format("%.1f", absAmount) end end local function createIndicator(humanoid, amount, isDeath) local head = humanoid.Parent:FindFirstChild("Head") or humanoid.Parent:FindFirstChild("HumanoidRootPart") if not head then return end -- 1. Handle Stacking & Timer Reset if ActiveIndicators[humanoid] then local data = ActiveIndicators[humanoid] -- If the 5s window has passed, start a new total. Otherwise, add to it. if tick() - data.LastHitTime > STACK_RESET_TIME then data.TotalDamage = math.abs(amount) else data.TotalDamage = data.TotalDamage + math.abs(amount) end data.LastHitTime = tick() data.AnimationStart = tick() -- Reset the 1.3s float/fade animation data.IsDeath = isDeath or data.IsDeath -- Instant UI Update data.Label.TextTransparency = 0 data.Label.TextStrokeTransparency = 0 if data.IsDeath then data.Label.Text = "DEATH" data.Label.TextColor3 = DEATH_COLOR else data.Label.Text = formatDamage(data.TotalDamage) data.Label.TextColor3 = (data.TotalDamage >= HEAVY_HIT_THRESHOLD) and Color3.new(1, 1, 1) or DAMAGE_COLOR end return end -- 2. Create New Indicator (Locked to Head) local billboard = Instance.new("BillboardGui") billboard.Size = UDim2.new(BASE_SIZE, 0, BASE_SIZE, 0) billboard.Adornee = head billboard.AlwaysOnTop = true local label = Instance.new("TextLabel") label.Size = UDim2.new(1, 0, 1, 0) label.BackgroundTransparency = 1 label.TextScaled = true label.Font = Enum.Font.Cartoon label.TextStrokeColor3 = Color3.fromRGB(0, 0, 0) label.TextStrokeTransparency = 0 label.Rotation = math.random(-15, 15) local total = math.abs(amount) label.Text = isDeath and "DEATH" or formatDamage(total) label.TextColor3 = isDeath and DEATH_COLOR or (total >= HEAVY_HIT_THRESHOLD and Color3.new(1, 1, 1) or DAMAGE_COLOR) label.Parent = billboard billboard.Parent = game.CoreGui local data = { Billboard = billboard, Label = label, TotalDamage = total, LastHitTime = tick(), AnimationStart = tick(), IsDeath = isDeath } ActiveIndicators[humanoid] = data -- 3. Animation Loop task.spawn(function() while tick() - data.AnimationStart < DISPLAY_TIME do local elapsed = tick() - data.AnimationStart local progress = elapsed / DISPLAY_TIME local isHeavy = data.TotalDamage >= HEAVY_HIT_THRESHOLD -- Safety check for deleted heads if not head or not head.Parent then break end -- Strobe Logic if isHeavy and not data.IsDeath then label.TextColor3 = (math.sin(tick() * 25) > 0) and Color3.new(1, 1, 1) or Color3.new(1, 0, 0) end -- Shake & Sizing local currentShake = data.IsDeath and (BASE_SHAKE * 3) or (isHeavy and BASE_SHAKE * 2 or BASE_SHAKE) local sizeMult = 1.0 if progress < 0.25 then sizeMult = data.IsDeath and 2.0 or (isHeavy and 1.7 or 1.4) sizeMult = sizeMult - (progress * 1.5) end billboard.Size = UDim2.new(BASE_SIZE * sizeMult, 0, BASE_SIZE * sizeMult, 0) -- Floating & Shaking (Locked to Head via StudsOffset) local yOffset = 3 + (progress * 3.5) local shakeX = (math.random() - 0.5) * currentShake local shakeY = (math.random() - 0.5) * currentShake billboard.StudsOffset = Vector3.new(shakeX, yOffset + shakeY, 0) -- Fade label.TextTransparency = progress label.TextStrokeTransparency = progress task.wait() end billboard:Destroy() ActiveIndicators[humanoid] = nil end) end local function watchHumanoid(humanoid) local lastHealth = humanoid.Health humanoid.HealthChanged:Connect(function(newHealth) local delta = newHealth - lastHealth if delta <= -0.1 then createIndicator(humanoid, delta, (newHealth <= 0 and lastHealth > 0)) end lastHealth = newHealth end) end for _, v in pairs(workspace:GetDescendants()) do if v:IsA("Humanoid") then watchHumanoid(v) end end workspace.DescendantAdded:Connect(function(v) if v:IsA("Humanoid") then watchHumanoid(v) end end)