Skip to content

Instantly share code, notes, and snippets.

@SweptThrone
Created September 8, 2022 22:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SweptThrone/ed5eaa78298c2fa430faeacd43670bd9 to your computer and use it in GitHub Desktop.
Save SweptThrone/ed5eaa78298c2fa430faeacd43670bd9 to your computer and use it in GitHub Desktop.
STStamina Neu HUD
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