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