module.stopalltracks=function(e,c)local D=e:GetPlayingAnimationTracks()local U=c local W={}if U then for e,c in pairs(U:GetDescendants())do if c:IsA("\065\110\105\109\097\116\105\111\110")then W[c.Name]=c.Name end end for e,c in pairs(e.Animator:GetPlayingAnimationTracks())do if U:FindFirstChild(c.Name)and c.Name==(U:FindFirstChild(c.Name)).Name then c:Stop()end end else for e,c in pairs(D)do c:Stop()end end end module.StopAnim=function(e,c)for e,D in pairs(e.Animator:GetPlayingAnimationTracks())do if D.Name==c then D:Stop()end end end module.LoadTrack=function(e,c)local D if e:FindFirstChild("\065\110\105\109\097\116\111\114")then D=e.Animator:LoadAnimation(c)else D=e:LoadAnimation(c)end return D end module.play=function(e,c)local D=e.Parent local U=e.Animator:LoadAnimation(c)U:Play()return U end

module.stopalltracks = function(hum, fold)
	local AnimationTracks = hum:GetPlayingAnimationTracks()
	local Fold =  fold
	
	local tab = {}
	
	if Fold then
		
		--
		for i, track in pairs (Fold:GetDescendants()) do
			if track:IsA('Animation') then
				tab[track.Name] = track.Name
				--table.insert(tab, track.Name)
			end
		end
		
		--print(tab)
		-- action
		for i, v in pairs(hum.Animator:GetPlayingAnimationTracks()) do
			if Fold:FindFirstChild(v.Name) and v.Name == Fold:FindFirstChild(v.Name).Name then
				v:Stop()
				--print("Fold found match: ",v," Table found ->", tab[v])
			end
		end
		
	else
		for i, track in pairs (AnimationTracks) do
			track:Stop()
		end
	end
	

end

module.StopAnim = function(hum,name)
	for i, v in pairs(hum.Animator:GetPlayingAnimationTracks()) do
		if v.Name == name then
			v:Stop()
		end
	end
end

module.LoadTrack = function(hum, anim)
	local animationTrack
	if hum:FindFirstChild("Animator") then
		animationTrack = hum.Animator:LoadAnimation(anim)
	else
		animationTrack = hum:LoadAnimation(anim)
	end
	
	--animationTrack:Play()


	return animationTrack
end

module.play = function(hum, anim)
	local char = hum.Parent
	
	local animationTrack = hum.Animator:LoadAnimation(anim)
	animationTrack:Play()
	
	
	return animationTrack
	
end
