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