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