Created
September 8, 2022 22:52
-
-
Save SweptThrone/ed5eaa78298c2fa430faeacd43670bd9 to your computer and use it in GitHub Desktop.
STStamina Neu HUD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hook.Add( "HUDPaint", "DrawST2StaminaHUD", function() | |
local ply = LocalPlayer() | |
local stam = ply:GetStamina() | |
smoothStam = smoothStam or 100 | |
smoothStam = Lerp( 15 * FrameTime(), smoothStam, stam ) | |
surface.SetDrawColor( 0, 0, 0, 255 ) | |
surface.DrawRect( 20, ScrH() - 15, LocalPlayer():GetStaminaCap() * 3, 5 ) | |
surface.SetDrawColor( 64, 0, 0, 255 ) | |
surface.DrawRect( 20, ScrH() - 15, 75, 5 ) | |
surface.SetDrawColor( 255, smoothStam <= 25 and TimedSin( 2, 127, 255, 0 ) or 255, 0, 255 ) | |
surface.DrawRect( 20, ScrH() - 15, math.Round( smoothStam * 3 ), 5 ) | |
end ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment