function configureAnimationSetOld(b,V)if animTable[b]~=nil then for b,V in pairs(animTable[b].connections)do V:disconnect()end end animTable[b]={}animTable[b].count=0 animTable[b].totalWeight=0 animTable[b].connections={}local r=true local g,T=pcall(function()r=(game:GetService("\083\116\097\114\116\101\114\080\108\097\121\101\114")).AllowCustomAnimations end)if not g then r=true end local B=script:FindFirstChild(b)if r and B~=nil then table.insert(animTable[b].connections,B.ChildAdded:connect(function(r)configureAnimationSet(b,V)end))table.insert(animTable[b].connections,B.ChildRemoved:connect(function(r)configureAnimationSet(b,V)end))local r=1 for g,T in pairs(B:GetChildren())do if T:IsA("\065\110\105\109\097\116\105\111\110")then table.insert(animTable[b].connections,T.Changed:connect(function(r)configureAnimationSet(b,V)end))animTable[b][r]={}animTable[b][r].anim=T local g=T:FindFirstChild("\087\101\105\103\104\116")if g==nil then animTable[b][r].weight=1 else animTable[b][r].weight=g.Value end animTable[b].count=animTable[b].count+1 animTable[b].totalWeight=animTable[b].totalWeight+animTable[b][r].weight r=r+1 end end end if animTable[b].count<=0 then for V,r in pairs(V)do animTable[b][V]={}animTable[b][V].anim=Instance.new("\065\110\105\109\097\116\105\111\110")animTable[b][V].anim.Name=b animTable[b][V].anim.AnimationId=r.id animTable[b][V].weight=r.weight animTable[b].count=animTable[b].count+1 animTable[b].totalWeight=animTable[b].totalWeight+r.weight end end for b,V in pairs(animTable)do for b=1,V.count,1 do Humanoid:LoadAnimation(V[b].anim)end end end


function configureAnimationSetOld(name, fileList)
	if (animTable[name] ~= nil) then
		for _, connection in pairs(animTable[name].connections) do
			connection:disconnect()
		end
	end
	animTable[name] = {}
	animTable[name].count = 0
	animTable[name].totalWeight = 0	
	animTable[name].connections = {}

	local allowCustomAnimations = true

	local success, msg = pcall(function() allowCustomAnimations = game:GetService("StarterPlayer").AllowCustomAnimations end)
	if not success then
		allowCustomAnimations = true
	end

	-- check for config values
	local config = script:FindFirstChild(name)
	if (allowCustomAnimations and config ~= nil) then
		table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
		table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
		local idx = 1
		for _, childPart in pairs(config:GetChildren()) do
			if (childPart:IsA("Animation")) then
				table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
				animTable[name][idx] = {}
				animTable[name][idx].anim = childPart
				local weightObject = childPart:FindFirstChild("Weight")
				if (weightObject == nil) then
					animTable[name][idx].weight = 1
				else
					animTable[name][idx].weight = weightObject.Value
				end
				animTable[name].count = animTable[name].count + 1
				animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
				idx = idx + 1
			end
		end
	end

	-- fallback to defaults
	if (animTable[name].count <= 0) then
		for idx, anim in pairs(fileList) do
			animTable[name][idx] = {}
			animTable[name][idx].anim = Instance.new("Animation")
			animTable[name][idx].anim.Name = name
			animTable[name][idx].anim.AnimationId = anim.id
			animTable[name][idx].weight = anim.weight
			animTable[name].count = animTable[name].count + 1
			animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
			-- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
		end
	end

	-- preload anims
	for i, animType in pairs(animTable) do
		for idx = 1, animType.count, 1 do 
			Humanoid:LoadAnimation(animType[idx].anim)
		end
	end
end
