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