local n={}local I={}local w={ID=0;Type="\084\101\120\116\066\117\116\116\111\110",Properties={Font=Enum.Font.SourceSans;Name="\067\111\108\111\114\084\101\109\112\108\097\116\101";TextColor3=Color3.new(0,0,0),Size=UDim2.new(0,100,0,100);Text="",TextSize=14,BackgroundColor3=Color3.new(1,1,1)},Children={{ID=1,Type="\085\073\067\111\114\110\101\114",Properties={CornerRadius=UDim.new(.5)};Children={}},{ID=2,Type="\073\109\097\103\101\076\097\098\101\108";Properties={Visible=false;ScaleType=Enum.ScaleType.Fit,ImageColor3=Color3.new(0,1,.49803921568627);BackgroundTransparency=1;Image="\114\098\120\097\115\115\101\116\058\047\047\116\101\120\116\117\114\101\115\047\065\118\097\116\097\114\069\100\105\116\111\114\073\109\097\103\101\115\047\083\104\101\101\116\046\112\110\103";Name="\087\101\097\114\105\110\103",ImageRectSize=Vector2.new(94,94),ImageRectOffset=Vector2.new(604,574),Size=UDim2.new(1,0,1,0);BackgroundColor3=Color3.new(1,1,1),SliceCenter=Rect.new(Vector2.new(49,49),Vector2.new(49,49))},Children={}}}}local function E(w,J)local Q=Instance.new(w.Type)if w.ID then local E=I[w.ID]if E then E[1][E[2]]=Q I[w.ID]=nil else n[w.ID]=Q end end for w,E in pairs(w.Properties)do if type(E)=="\115\116\114\105\110\103"then local J=tonumber(E:match("\094\095\082\058\040\037\119\043\041\095\036"))if J then if n[J]then E=n[J]else I[J]={Q,w}E=nil end end end Q[w]=E end for n,I in pairs(w.Children)do E(I,Q)end Q.Parent=J return Q end return function()return E(w,nil)end
local partsWithId = {}
local awaitRef = {}

local root = {
	ID = 0;
	Type = "TextButton";
	Properties = {
		Font = Enum.Font.SourceSans;
		Name = "ColorTemplate";
		TextColor3 = Color3.new(0,0,0);
		Size = UDim2.new(0,100,0,100);
		Text = "";
		TextSize = 14;
		BackgroundColor3 = Color3.new(1,1,1);
	};
	Children = {
		{
			ID = 1;
			Type = "UICorner";
			Properties = {
				CornerRadius = UDim.new(0.5);
			};
			Children = {};
		};
		{
			ID = 2;
			Type = "ImageLabel";
			Properties = {
				Visible = false;
				ScaleType = Enum.ScaleType.Fit;
				ImageColor3 = Color3.new(0,1,127/255);
				BackgroundTransparency = 1;
				Image = "rbxasset://textures/AvatarEditorImages/Sheet.png";
				Name = "Wearing";
				ImageRectSize = Vector2.new(94,94);
				ImageRectOffset = Vector2.new(604,574);
				Size = UDim2.new(1,0,1,0);
				BackgroundColor3 = Color3.new(1,1,1);
				SliceCenter = Rect.new(Vector2.new(49,49),Vector2.new(49,49));
			};
			Children = {};
		};
	};
};

local function Scan(item, parent)
	local obj = Instance.new(item.Type)
	if (item.ID) then
		local awaiting = awaitRef[item.ID]
		if (awaiting) then
			awaiting[1][awaiting[2]] = obj
			awaitRef[item.ID] = nil
		else
			partsWithId[item.ID] = obj
		end
	end
	for p,v in pairs(item.Properties) do
		if (type(v) == "string") then
			local id = tonumber(v:match("^_R:(%w+)_$"))
			if (id) then
				if (partsWithId[id]) then
					v = partsWithId[id]
				else
					awaitRef[id] = {obj, p}
					v = nil
				end
			end
		end
		obj[p] = v
	end
	for _,c in pairs(item.Children) do
		Scan(c, obj)
	end
	obj.Parent = parent
	return obj
end

return function() return Scan(root, nil) end