local C={}local s={}function s.StopAnimation(s)local p=C[s]if p then p:Stop()end end function s.PlayAnimation(s)local p=C[s]if p then if p.IsPlaying==false then p:Play()end else p=((game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")):WaitForChild("\065\110\105\109\097\116\105\111\110\115")):FindFirstChild(s)if p then p=script.Parent:LoadAnimation(p)p:Play()C[s]=p end end end return s
-- this script makes keeping track of loaded animations easy; goes inside of humanoids

local loadedAnimations = {}
local module = {}

function module.StopAnimation(animationName)
	local animation = loadedAnimations[animationName]
	if animation then
		animation:Stop()
	end
end

function module.PlayAnimation(animationName)
	local animation = loadedAnimations[animationName]
	if animation then
		if animation.IsPlaying == false then
			animation:Play()
		end
	else
		animation = game:GetService("ReplicatedStorage"):WaitForChild("Animations"):FindFirstChild(animationName)
		if animation then
			animation = script.Parent:LoadAnimation(animation)
			animation:Play()
			loadedAnimations[animationName] = animation
		end
	end
end

return module
