So after the InputEnded, the animation that is being played is supposed to end, but it keeps going and I can't figure out why.
local UIS = game:GetService("UserInputService")
local char = game:GetService("Players").LocalPlayer.Character
local held = false
running = game:GetService("ReplicatedStorage").Values.isRunning
animPlaying = game:GetService("ReplicatedStorage").Values.animIsPlaying
runningAnim = Instance.new("Animation")
runningAnim.AnimationId = "rbxassetid://3241411573"
UIS.InputBegan:Connect(function(inputObj)
animTrack = char.Humanoid:LoadAnimation(runningAnim)
if inputObj.KeyCode == Enum.KeyCode.LeftShift and held == false and animPlaying.Value == false then
print("Being held!")
char.Humanoid.WalkSpeed = 20
animTrack:Play()
animTrack.Priority = 1
running.Value = true
held = true
end
UIS.InputEnded:Connect(function(inputObj2)
if inputObj2.KeyCode == Enum.KeyCode.LeftShift and held == true then
char.Humanoid.WalkSpeed = 13
animTrack:Stop()
running.Value = false
held = false
end
end)
end)
