--by pavetr.top/ds local reloadStartTime = 0 local reloadCooldown = false local barWidth = 300 local barHeight = 20 hook.Add("PlayerBindPress", debug.getinfo(1).short_src, function(ply, bind, pressed) if bind == "+reload" and pressed and not reloadCooldown then reloadStartTime = CurTime() reloadCooldown = true end end) local LocalPlayer = LocalPlayer() hook.Add("HUDPaint", debug.getinfo(1).short_src, function() if LocalPlayer:Health() <= 0 then return end local weapon = LocalPlayer:GetViewModel() if weapon:IsValid() then local seqTime = weapon:SequenceDuration() local timeLeft = seqTime - (CurTime() - reloadStartTime) local x = (ScrW() - barWidth) / 2 local y = ScrH() - 50 surface.SetDrawColor(0, 0, 0, 150) draw.RoundedBox(4, x, y, barWidth, barHeight, Color(0, 0, 0, 100)) if timeLeft > 0 then surface.SetDrawColor(255, 245, 78, 255) local fillWidth = (timeLeft / seqTime) * barWidth draw.RoundedBox(4, x, y, fillWidth, barHeight, Color(255, 245, 78, 255)) else reloadCooldown = false reloadStartTime = 0 end else local x = (ScrW() - barWidth) / 2 local y = ScrH() - 50 surface.SetDrawColor(0, 0, 0, 150) draw.RoundedBox(4, x, y, barWidth, barHeight, Color(0, 0, 0, 100)) end end)