Stamina set on spawn & in the HUD
This commit is contained in:
parent
5520c921c1
commit
b6b9c4d017
|
@ -281,8 +281,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
|
||||||
render.SetScissorRect( 0, 0, 0, 0, false ) -- Disable after you are done
|
render.SetScissorRect( 0, 0, 0, 0, false ) -- Disable after you are done
|
||||||
|
|
||||||
if true then -- Stamina
|
if true then -- Stamina
|
||||||
local perc = CurTime()*0.5 % 2
|
local perc = p:GetStamina()
|
||||||
if perc > 1 then perc = 2-perc end
|
|
||||||
for i=1, 4 do
|
for i=1, 4 do
|
||||||
local localperc = math.Clamp( math.Remap( perc, (0.25*(i-1)), (0.25*(i)), 0, 1 ), 0, 1 )
|
local localperc = math.Clamp( math.Remap( perc, (0.25*(i-1)), (0.25*(i)), 0, 1 ), 0, 1 )
|
||||||
surface.SetDrawColor( scheme["fg"] )
|
surface.SetDrawColor( scheme["fg"] )
|
||||||
|
|
|
@ -7,6 +7,8 @@ function GM:PlayerSpawn( ply )
|
||||||
ply:SetPlayerColor( Vector( 0.275, 0.2, 0.145 ) )
|
ply:SetPlayerColor( Vector( 0.275, 0.2, 0.145 ) )
|
||||||
ply:Give( "benny" )
|
ply:Give( "benny" )
|
||||||
|
|
||||||
|
ply:SetStamina( 1 )
|
||||||
|
|
||||||
ply:SetCrouchedWalkSpeed( 0.3 )
|
ply:SetCrouchedWalkSpeed( 0.3 )
|
||||||
ply:SetDuckSpeed( 0.1 )
|
ply:SetDuckSpeed( 0.1 )
|
||||||
ply:SetUnDuckSpeed( 0.1 )
|
ply:SetUnDuckSpeed( 0.1 )
|
||||||
|
|
Loading…
Reference in New Issue