How to replicate animations to another object smoothly? checking if anims already playing and good loop

I want to replicate an animation playing from a tool to a viewmodel of it, i have the viewmodel working.
i just want to get the animations replicated. i put this together tryin to test the viewmodel

while task.wait(.1) do
	if ToolEquipped then
		for _, playingTrack in pairs(Character.Humanoid:WaitForChild("Animator"):GetPlayingAnimationTracks()) do
			if playingTrack then
				for _, v in pairs(WorkspaceTool:WaitForChild("Animations"):GetChildren()) do
					if v.AnimationId then
						if v.AnimationId.IsPlaying == false then
								ViewModelAnimationController:LoadAnimation(playingTrack.Animation):Play()
							end
						end
					end
				end
			end
		end
end

but this works bad, the animations replaying itself idk how to check if its already playing , is there any event that sets off everytime an animation is played? and if not whats a good way of working a loop checking for animations and will play them without duplicating anims