function MonitorStamina()while Run_Key_Pressed do if not Aimed and not Aiming then break end RS:wait()end while Run_Key_Pressed and(not Aiming and(not Aimed and(not Knifing and not ThrowingGrenade)))do local c=Keys.w or Keys[string.char(17)]local X=Keys.s or Keys[string.char(18)]if(c and not X)and(Walking and Stamina>0)then if Stance==1 or Stance==2 then Stand()end local c=Stamina-1 Stamina=c<0 and 0 or c Running=true elseif not(c and not X)or not Walking or Stamina==0 then break end RS:wait()end Running=false RechargeStamina()end function RechargeStamina()ChargingStamina=true while(not Run_Key_Pressed or Stamina<MaxStamina)and not Running do if Stamina<MaxStamina then local c=Stamina+S.SprintTime/S.StaminaCoolTime Stamina=c>MaxStamina and MaxStamina or c elseif Stamina>=MaxStamina then break end RS:wait()end ChargingStamina=false end
--------------------[ SPRINTING FUNCTIONS ]-------------------------------------------

function MonitorStamina()
	while Run_Key_Pressed do
		if (not Aimed) and not Aiming then
			break
		end
		RS:wait()
	end
	while Run_Key_Pressed and not Aiming and not Aimed and not Knifing and not ThrowingGrenade do
		local Forward = (Keys["w"] or Keys[string.char(17)])
		local Backward = (Keys["s"] or Keys[string.char(18)])
		if (Forward and not Backward) and Walking and (Stamina > 0) then
			if Stance == 1 or Stance == 2 then
				Stand()
			end
			local NewStamina = Stamina - 1
			Stamina = (NewStamina < 0 and 0 or NewStamina)
			Running = true
		elseif (not (Forward and not Backward)) or not Walking or (Stamina == 0) then
			break
		end
		RS:wait()
	end
	Running = false
	RechargeStamina()
end

function RechargeStamina()
	ChargingStamina = true
	while ((not Run_Key_Pressed) or (Stamina < MaxStamina)) and not Running do
		if Stamina < MaxStamina then
			local NewStamina = Stamina + (S.SprintTime / S.StaminaCoolTime)
			Stamina = (NewStamina > MaxStamina and MaxStamina or NewStamina)
		elseif Stamina >= MaxStamina then
			break
		end
		RS:wait()
	end
	ChargingStamina = false
end
