Run Animation wont override Walking Animation when Sprinting

Animation Priority:
Walk - Movement
Idle - Idle
Run - Action

idk how to fix it

Shift to Sprint Code:

-- SpeedScriptRunner | Version 2.2 | Claasgreeneye

--< Services >--
local Players: Players = game:GetService("Players")
local TweenService: TweenService = game:GetService("TweenService")
local UIS: UserInputService = game:GetService("UserInputService")

--< Constants >--
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid: Humanoid = Character:WaitForChild("Humanoid")
local Camera: Camera = workspace.CurrentCamera

local DefaultFieldOFView = Camera.FieldOfView
local DefaultWalkingSpeed = Humanoid.WalkSpeed

--< Variables >--
local Speed: number = 50 -- How fast is the sprinting speed?
local Key: Enum.KeyCode = Enum.KeyCode.LeftShift -- Activation Key
local TweenSpeed: number = 0.4 -- How fast does the field of view change?

--< Main Code >--
local SprintingTween: Tween = TweenService:Create(Camera, TweenInfo.new(TweenSpeed), { FieldOfView = DefaultFieldOFView + (Speed / 5) })
local WalkingTween: Tween = TweenService:Create(Camera, TweenInfo.new(TweenSpeed), { FieldOfView = DefaultFieldOFView })

UIS.InputBegan:Connect(function(Input: InputObject, Processed: boolean)
	if not Processed then 
		if Input.UserInputType == Enum.UserInputType.Keyboard and Input.KeyCode == Key then 
			Humanoid.WalkSpeed = Speed
			SprintingTween:Play()
		end
	end
end)

UIS.InputEnded:Connect(function(Input: InputObject)
	if Input.UserInputType == Enum.UserInputType.Keyboard and Input.KeyCode == Key then 
		Humanoid.WalkSpeed = DefaultWalkingSpeed
		WalkingTween:Play()
	end
end)

--< Player Resetting >--
Player.CharacterAdded:Connect(function(Char)
	Humanoid = Char:FindFirstChildWhichIsA("Humanoid") or Char:WaitForChild("Humanoid")
end)

You could try putting it inside an elseif statement which would go like this: (but obviously with the correct scripting)

if running == true and if moving == true(so it doesn’t run when idle) then
–play the running anim
elseif moving == true then
– play the walking anim