How to fix glitched animations?

I have a tool that upon equipping,deletes the original “animate” located in the character,and inserts my own.
If you Unequip it it deletes the added anims and adds back the orginal “animate”

For some reason if the character is moving or jumping the animations,glitch making animations like the idle of the inserted anims “twitch” or just not animate at all.

Can somebody please help,or point in the right direction?

Can you show us your script please ?

Here it is

Script 1:


	local Characters = script.Parent.Parent


	local sa = script.SwordAnims:Clone()
	sa.Parent = Characters

Script 2:

local tool = script.Parent

	local Players = game:GetService("Players")
	for i,player in pairs(Players:GetPlayers()) do
		--if (player ~= nil) then
		local Character = player.Character
		local Animate = script.Parent.SwordGiverAndRemover.Animate:Clone()
		Animate.Parent = Character



Is it in a local script? If so try making it use a remote or just a server script