Motor6D animation doesn't work as expected

I made an animation in moon animator. I used motor6D for that while animating and it did work, but it doesn’t work in game

This is my motor6D injection script:

game:GetService("Players").PlayerAdded:Connect(function(plr)	
	plr.CharacterAdded:Connect(function(char)
		wait(5)
		
		local M6D = Instance.new("Motor6D", char.RightHand)
		M6D.Part0 = char.RightHand
		M6D.Name = "Handle"
	end)
end)

game.ReplicatedStorage.ConnectM6D.Event:Connect(function(char,location) -- location = tool's handle
	char:WaitForChild("RightHand"):WaitForChild("Handle").Part0 = char.RightHand
	char:WaitForChild("RightHand"):WaitForChild("Handle").Part1 = location
end)

game.ReplicatedStorage.DisconnectM6D.Event:Connect(function(char)
	char.RightHand.Handle.Part1 = nil
end)

It runs everytime the tool is equipped and unequipped. I’m also making multiple tools so I can’t change the motor6D to the handle upon spawn already