function configureAnimationSetOld(G,z)if animTable[G]~=nil then for G,z in pairs(animTable[G].connections)do z:disconnect()end end animTable[G]={}animTable[G].count=0 animTable[G].totalWeight=0 animTable[G].connections={}local o=true local a,C=pcall(function()o=(game:GetService("\083\116\097\114\116\101\114\080\108\097\121\101\114")).AllowCustomAnimations end)if not a then o=true end local E=script:FindFirstChild(G)if o and E~=nil then table.insert(animTable[G].connections,E.ChildAdded:connect(function(o)configureAnimationSet(G,z)end))table.insert(animTable[G].connections,E.ChildRemoved:connect(function(o)configureAnimationSet(G,z)end))local o=1 for a,C in pairs(E:GetChildren())do if C:IsA("\065\110\105\109\097\116\105\111\110")then table.insert(animTable[G].connections,C.Changed:connect(function(o)configureAnimationSet(G,z)end))animTable[G][o]={}animTable[G][o].anim=C local a=C:FindFirstChild("\087\101\105\103\104\116")if a==nil then animTable[G][o].weight=1 else animTable[G][o].weight=a.Value end animTable[G].count=animTable[G].count+1 animTable[G].totalWeight=animTable[G].totalWeight+animTable[G][o].weight o=o+1 end end end if animTable[G].count<=0 then for z,o in pairs(z)do animTable[G][z]={}animTable[G][z].anim=Instance.new("\065\110\105\109\097\116\105\111\110")animTable[G][z].anim.Name=G animTable[G][z].anim.AnimationId=o.id animTable[G][z].weight=o.weight animTable[G].count=animTable[G].count+1 animTable[G].totalWeight=animTable[G].totalWeight+o.weight end end if PreloadAnimsUserFlag then for G,z in pairs(animTable)do for G=1,z.count,1 do Humanoid:LoadAnimation(z[G].anim)end 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
	if PreloadAnimsUserFlag then
		for i, animType in pairs(animTable) do
			for idx = 1, animType.count, 1 do 
				Humanoid:LoadAnimation(animType[idx].anim)
			end
		end
	end
end
