From b6b9c4d017e91750ea34ee4c73587d31bd5237a3 Mon Sep 17 00:00:00 2001 From: Fesiug Date: Tue, 28 Nov 2023 23:11:10 -0500 Subject: [PATCH] Stamina set on spawn & in the HUD --- gamemodes/benny/gamemode/modules/player/cl_hud.lua | 3 +-- gamemodes/benny/gamemode/modules/player/sh_player.lua | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gamemodes/benny/gamemode/modules/player/cl_hud.lua b/gamemodes/benny/gamemode/modules/player/cl_hud.lua index 3d9a422..92b58cf 100644 --- a/gamemodes/benny/gamemode/modules/player/cl_hud.lua +++ b/gamemodes/benny/gamemode/modules/player/cl_hud.lua @@ -281,8 +281,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function() render.SetScissorRect( 0, 0, 0, 0, false ) -- Disable after you are done if true then -- Stamina - local perc = CurTime()*0.5 % 2 - if perc > 1 then perc = 2-perc end + local perc = p:GetStamina() for i=1, 4 do local localperc = math.Clamp( math.Remap( perc, (0.25*(i-1)), (0.25*(i)), 0, 1 ), 0, 1 ) surface.SetDrawColor( scheme["fg"] ) diff --git a/gamemodes/benny/gamemode/modules/player/sh_player.lua b/gamemodes/benny/gamemode/modules/player/sh_player.lua index 07ccef2..b2becd8 100644 --- a/gamemodes/benny/gamemode/modules/player/sh_player.lua +++ b/gamemodes/benny/gamemode/modules/player/sh_player.lua @@ -7,6 +7,8 @@ function GM:PlayerSpawn( ply ) ply:SetPlayerColor( Vector( 0.275, 0.2, 0.145 ) ) ply:Give( "benny" ) + ply:SetStamina( 1 ) + ply:SetCrouchedWalkSpeed( 0.3 ) ply:SetDuckSpeed( 0.1 ) ply:SetUnDuckSpeed( 0.1 )