When shift is clicked to sprint, when i release shift, animation doesnt stop

Im a not bad scripter, so i thought i could make a shift to sprint script myself, which i could, but the only twist is, when i hold shift, it does play the animation, but once i release shift, the animation doesnt stop. Im also trying to learn how to make input combinations, so if someone could give me a little guide to that, it would be well appreciated.

my script:

local UIS = game:GetService("UserInputService")
local TS = game:GetService("TweenService")

local camera = workspace.CurrentCamera

local hmd = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")

local cameraTweenInfo1 = TweenInfo.new(0.2,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0)
local cameraTweenGoal1 = {FieldOfView = 80}

local cameraTweenInfo2 = TweenInfo.new(0.2,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0)
local cameraTweenGoal2 = {FieldOfView = 70}

UIS.InputBegan:Connect(function(input, gameProcessed)
	if not gameProcessed then
		if input.KeyCode == Enum.KeyCode.LeftShift then
		game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 26
		local sprintAnim = hmd:LoadAnimation(script.SprintAnim)
		sprintAnim:Play()
		local cameraTween1 = TS:Create(camera,cameraTweenInfo1,cameraTweenGoal1)
		cameraTween1:Play()	
		end
	end
end)

UIS.InputEnded:Connect(function(input, gameProcessed)
	if not gameProcessed then
		if input.KeyCode == Enum.KeyCode.LeftShift then
		game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
		local sprintAnim = hmd:LoadAnimation(script.SprintAnim)
		sprintAnim:Stop()
		local cameraTween2 = TS:Create(camera,cameraTweenInfo2,cameraTweenGoal2)
		cameraTween2:Play()
		end
	end
end)

i also have this in startergui, if i need to change that.

Thats because you create different animation tracks every time you start or stop running. To fix this we will need only one animation track that we play and stop. Here:

local UIS = game:GetService("UserInputService")
local TS = game:GetService("TweenService")

local camera = workspace.CurrentCamera

local Character = game:GetService("Players").LocalPlayer.CharacterAppearanceLoaded:Wait()

local animator = Character:FindFirstChildOfClass("Humanoid"):FindFirstChildOfClass("Animator")

local cameraTweenInfo1 = TweenInfo.new(0.2,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0)
local cameraTweenGoal1 = {FieldOfView = 80}

local cameraTweenInfo2 = TweenInfo.new(0.2,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0)
local cameraTweenGoal2 = {FieldOfView = 70}

local sprintAnim = animator:LoadAnimation(script.SprintAnim)

UIS.InputBegan:Connect(function(input, gameProcessed)
	if not gameProcessed then
		if input.KeyCode == Enum.KeyCode.LeftShift then
			game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 26
			sprintAnim:Play()
			local cameraTween1 = TS:Create(camera,cameraTweenInfo1,cameraTweenGoal1)
			cameraTween1:Play()	
		end
	end
end)

UIS.InputEnded:Connect(function(input, gameProcessed)
	if not gameProcessed then
		if input.KeyCode == Enum.KeyCode.LeftShift then
			game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
			sprintAnim:Stop()
			local cameraTween2 = TS:Create(camera,cameraTweenInfo2,cameraTweenGoal2)
			cameraTween2:Play()
		end
	end
end)

ohhhhh, i undestand now, thank you very much. It makes a lot more sense now. So if im using 2 animation tracks, only the 2nd one gets stopped, and not the 1st one. I appreciate the help