module.stopalltracks=function(D,n)local X=D:GetPlayingAnimationTracks()local b=n local J={}if b then for D,n in pairs(b:GetDescendants())do if n:IsA("\065\110\105\109\097\116\105\111\110")then J[n.Name]=n.Name end end for D,n in pairs(D.Animator:GetPlayingAnimationTracks())do if b:FindFirstChild(n.Name)and n.Name==(b:FindFirstChild(n.Name)).Name then n:Stop()end end else for D,n in pairs(X)do n:Stop()end end end module.StopAnim=function(D,n)for D,X in pairs(D.Animator:GetPlayingAnimationTracks())do if X.Name==n then X:Stop()end end end module.LoadTrack=function(D,n)local X if D:FindFirstChild("\065\110\105\109\097\116\111\114")then X=D.Animator:LoadAnimation(n)else X=D:LoadAnimation(n)end return X end module.play=function(D,n)local X=D.Parent local b=D.Animator:LoadAnimation(n)b:Play()return b end
-- stops all playin anims
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
