Bug support [ Animation bug inside Script ]

Hey; I have an issue with changing animations, I am using the basic “Animate” script from roblox, but I also created something for animations from the server. Here are some gifs that show my problem;
https://gyazo.com/2a4ba913f40304c8e01888962ffb5b3d – In this gif the idle animation doesn’t even play.
https://gyazo.com/92a1fcc7f561c6cb32578e3c141fb1ca – In this gif you can see that the animation plays but even after I unequip the sword the animation keeps playing.

Here is my script:

		if Character.Status.Equipped.Value == false then
		Character.Status.Stance.Value = 1
		playerAnimations[Player].Equip:Play()
		
		if Character:FindFirstChild("SwordModel") then
			Character:FindFirstChild("SwordModel"):Remove()
		end
		
		local RightHand = Character:FindFirstChild("RightHand")
		
		if RightHand ~= nil then
			local Handle = ReplicatedStorage.Assets.Swords.Handle:Clone()
			Handle.Anchored = false
			
			Character.Animate.idle.Animation1.AnimationId = "rbxassetid://04571993026"
			Character.Animate.idle.Animation2.AnimationId = "rbxassetid://04571993026"
			Character.Animate.walk.RunAnim.AnimationId = "rbxassetid://4576823513"
			Character.Animate.run.RunAnim.AnimationId = "rbxassetid://4576823513"
			wait(0.5)
			Handle.Transparency = 0
			Handle.CanCollide = false
			Handle.Parent = Character
			
			Character.Status.Equipped.Value = true
				
			local Weld = GlobalFunctions.createInstance({
				instance = "Weld",
				properties = {
					Name = "BackWeld",
					Part0 = RightHand,
					Part1 = Handle,
					C0 = CFrame.new(0,0.3,-2.7) * CFrame.fromEulerAnglesXYZ(math.rad(0),math.rad(180),-20.5),
					Parent = Handle
				}
			})
			
			playerAnimations[Player].Idle1:Play()
			
			Handle.DefaultTrail.Enabled = true
		end
	elseif Character.Status.Equipped.Value == true then
		Character.Animate.idle.Animation1.AnimationId = "rbxassetid://4415102541"
		Character.Animate.idle.Animation2.AnimationId = "rbxassetid://4415102541"
		
		Character.Animate.walk.RunAnim.AnimationId = "rbxassetid://4571939343"
		Character.Animate.run.RunAnim.AnimationId = "rbxassetid://4571939343"
		
		playerAnimations[Player].Unequip:Play()
		
		--playerAnimations[Player].MainIdle:Play()
		
		wait(0.5)
		
		if Character:FindFirstChild("Handle") then
			Character:FindFirstChild("Handle"):Remove()
		end
		
		Character.Status.Equipped.Value = false
	end
end

So far I have tried stopping all of the playing animations, I have tried rewriting the “Animate” script to detect a value Change however neither of those have worked. I have also tried to make the animation change faster and it still doesn’t work.

That would be because you’re setting two animation ids to the same id. Due to the way the animate script handles weighting and fading between walks and runs, conflicting animation ids result in playback problems. You need different ids to fix this.

So in order to fix it I need to export the animation twice? Doing so will give it different IDS but the animation will be the same?

No. Your run and walk animations need to be completely different as well. Exporting the same animation twice for a different id is not sufficient enough.