function configureAnimationSetOld(C,h)if animTable[C]~=nil then for C,h in pairs(animTable[C].connections)do h:disconnect()end end animTable[C]={}animTable[C].count=0 animTable[C].totalWeight=0 animTable[C].connections={}local g=true local r=false local I,u=pcall(function()r=(UserSettings()):IsUserFeatureEnabled("\085\115\101\114\065\108\108\111\119\068\105\115\097\098\108\101\067\117\115\116\111\109\065\110\105\109\115\050")end)if r then local C,h=pcall(function()g=(game:GetService("\083\116\097\114\116\101\114\080\108\097\121\101\114")).AllowCustomAnimations end)if not C then g=true end end local e=script:FindFirstChild(C)if g and e~=nil then table.insert(animTable[C].connections,e.ChildAdded:connect(function(g)configureAnimationSet(C,h)end))table.insert(animTable[C].connections,e.ChildRemoved:connect(function(g)configureAnimationSet(C,h)end))local g=1 for r,I in pairs(e:GetChildren())do if I:IsA("\065\110\105\109\097\116\105\111\110")then table.insert(animTable[C].connections,I.Changed:connect(function(g)configureAnimationSet(C,h)end))animTable[C][g]={}animTable[C][g].anim=I local r=I:FindFirstChild("\087\101\105\103\104\116")if r==nil then animTable[C][g].weight=1 else animTable[C][g].weight=r.Value end animTable[C].count=animTable[C].count+1 animTable[C].totalWeight=animTable[C].totalWeight+animTable[C][g].weight g=g+1 end end end if animTable[C].count<=0 then for h,g in pairs(h)do animTable[C][h]={}animTable[C][h].anim=Instance.new("\065\110\105\109\097\116\105\111\110")animTable[C][h].anim.Name=C animTable[C][h].anim.AnimationId=g.id animTable[C][h].weight=g.weight animTable[C].count=animTable[C].count+1 animTable[C].totalWeight=animTable[C].totalWeight+g.weight end end if PreloadAnimsUserFlag then for C,h in pairs(animTable)do for C=1,h.count,1 do Humanoid:LoadAnimation(h[C].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 AllowDisableCustomAnimsUserFlag = false

	local success, msg = pcall(function()
		AllowDisableCustomAnimsUserFlag = UserSettings():IsUserFeatureEnabled("UserAllowDisableCustomAnims2")
	end)

	if AllowDisableCustomAnimsUserFlag then
		local success, msg = pcall(function()
			allowCustomAnimations = game:GetService("StarterPlayer").AllowCustomAnimations
		end)
		if not success then
			allowCustomAnimations = true
		end
	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
