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