script 1:
local crouchKey = Enum.KeyCode.C
local crouchSpeed = 8
local normalSpeed = 16
local crouchHeight = 1.5
local normalHeight = 2

local UIS = game:GetService("UserInputService")
local Players = game:GetService("Players")

local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")

local crouchIdleAnimation = humanoid:LoadAnimation(script.CrouchIdle)
local crouchWalkAnimation = humanoid:LoadAnimation(script.CrouchWalk)

local isCrouching = false
local isMoving = false

local function crouch()
	isCrouching = true
	humanoid.WalkSpeed = crouchSpeed
	humanoidRootPart.Size = Vector3.new(humanoidRootPart.Size.X, crouchHeight, humanoidRootPart.Size.Z)
	if isMoving then
		crouchIdleAnimation:Stop()
		crouchWalkAnimation:Play()
	else
		crouchWalkAnimation:Stop()
		crouchIdleAnimation:Play()
	end
end

local function stand()
	isCrouching = false
	humanoid.WalkSpeed = normalSpeed
	humanoidRootPart.Size = Vector3.new(humanoidRootPart.Size.X, normalHeight, humanoidRootPart.Size.Z)
	crouchIdleAnimation:Stop()
	crouchWalkAnimation:Stop()
end

humanoid:GetPropertyChangedSignal("MoveDirection"):Connect(function()
	if humanoid.MoveDirection.Magnitude > 0 then
		isMoving = true
		if isCrouching then
			crouchIdleAnimation:Stop()
			if not crouchWalkAnimation.IsPlaying then
				crouchWalkAnimation:Play()
			end
		end
	else
		isMoving = false
		if isCrouching then
			crouchWalkAnimation:Stop()
			if not crouchIdleAnimation.IsPlaying then
				crouchIdleAnimation:Play()
			end
		end
	end
end)

UIS.InputBegan:Connect(function(input)
	if input.KeyCode == crouchKey and not isCrouching then
		crouch()
	end
end)

UIS.InputEnded:Connect(function(input)
	if input.KeyCode == crouchKey and isCrouching then
		stand()
	end
end)

script 2:
--- // MODIFY THESE \\ ---

local defaultSpeed = 12
local sprintSpeed = 17
local normalFov = 70
local sprintFov = 80
local staminaDrainRate = 30
local staminaFillRate = 50
local staminaRegenDelay = 0.5
local sprintKey = Enum.KeyCode.LeftShift
local movementKeys = {Enum.KeyCode.W, Enum.KeyCode.A, Enum.KeyCode.S, Enum.KeyCode.D}


--- // Required Stuff \\ ---

local userInputService = game:GetService("UserInputService")
local tweenService = game:GetService("TweenService")
local runService = game:GetService("RunService")
local playersService = game:GetService("Players")
local player = playersService.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local camera = workspace.CurrentCamera
local sprintAnim = script:WaitForChild("SprintAnim")
local animTrack = humanoid:LoadAnimation(sprintAnim)
local healthBar = script.Parent.HealthBar.Bar
local shiftPressed = false
local movementKeysPressed = {}
local staminaDepleted = false
local sprinting = false
local stamina = 100
local maxStamina = 100
local minStamina = 0
local lastSprintTime = tick()
local staminaBar = script.Parent.StaminaBar.Bar
script.Parent.PlayerName.Text = player.Name
script.Parent.PlayerThumb.Image = "rbxthumb://type=AvatarHeadShot&id=" .. player.UserId .. "&w=420&h=420"


--- // FUNCTIONS \\ ---

local function tweenFov(duration, fov)
	local tween = tweenService:Create(camera, TweenInfo.new(duration, Enum.EasingStyle.Quad), { FieldOfView = fov })
	tween:Play()
	tween.Completed:Wait()
	tween:Destroy()
end

local function tweenStaminaBar()
	local tween = tweenService:Create(staminaBar, TweenInfo.new(0.25, Enum.EasingStyle.Quad), { Size = UDim2.new(stamina / maxStamina, 0, 1, 0) })
	tween:Play()
end

local function startSprinting()
	if not sprinting and stamina > minStamina then
		sprinting = true
		humanoid.WalkSpeed = sprintSpeed
		animTrack:Play()
		tweenFov(0.25, sprintFov)
	end
end

local function stopSprinting()
	if sprinting then
		sprinting = false
		humanoid.WalkSpeed = defaultSpeed
		animTrack:Stop()
		tweenFov(0.25, normalFov)
	end
end


--- // SIGNALS \\ ---

character.Humanoid:GetPropertyChangedSignal("Health"):Connect(function()
	healthBar.Size = UDim2.new(character.Humanoid.Health / 100, 0, 1, 0)
end)

userInputService.InputBegan:Connect(function(input, processed)
	if processed then return end
	if input.KeyCode == sprintKey then
		if not staminaDepleted then
			shiftPressed = true
			if next(movementKeysPressed) ~= nil then
				startSprinting()
			end
		end
	elseif table.find(movementKeys, input.KeyCode) then
		movementKeysPressed[input.KeyCode] = true
		if shiftPressed and not staminaDepleted then
			startSprinting()
		end
	end
end)

userInputService.InputEnded:Connect(function(input)
	if input.KeyCode == sprintKey then
		shiftPressed = false
		stopSprinting()
		if not userInputService:IsKeyDown(sprintKey) then
			staminaDepleted = false
		end
	elseif table.find(movementKeys, input.KeyCode) then
		movementKeysPressed[input.KeyCode] = nil
		if next(movementKeysPressed) == nil then
			stopSprinting()
		end
	end
end)

runService.RenderStepped:Connect(function(deltaTime)
	if sprinting then
		stamina = math.max(minStamina, stamina - staminaDrainRate * deltaTime)
		if stamina <= minStamina then
			staminaDepleted = true
			stopSprinting()
		end
		lastSprintTime = tick()
	else
		if tick() - lastSprintTime >= staminaRegenDelay then
			stamina = math.min(maxStamina, stamina + staminaFillRate * deltaTime)
		end
	end
	tweenStaminaBar()
end)


can you add script 1 to script 2 and the proper checks? for example, the player can't sprint and crouch at the same time, etc.