local V=script.Parent.Parent local s=require(V.Libraries.SupportLibrary)s.ImportServices()local j={Part=0,WedgePart=1;CornerWedgePart=2;VehicleSeat=3,Seat=4,TrussPart=5;SpecialMesh=6;Texture=7;Decal=8,PointLight=9;SpotLight=10,SurfaceLight=11,Smoke=12;Fire=13,Sparkles=14;Model=15;Folder=18}local l={Part="\080\097\114\116",WedgePart="\087\101\100\103\101";CornerWedgePart="\067\111\114\110\101\114\087\101\100\103\101",VehicleSeat="\086\101\104\105\099\108\101\083\101\097\116";Seat="\083\101\097\116",TrussPart="\084\114\117\115\115",SpecialMesh="\077\101\115\104";Texture="\084\101\120\116\117\114\101",Decal="\068\101\099\097\108";PointLight="\080\111\105\110\116\076\105\103\104\116";SpotLight="\083\112\111\116\076\105\103\104\116",SurfaceLight="\083\117\114\102\097\099\101\076\105\103\104\116",Smoke="\083\109\111\107\101",Fire="\070\105\114\101";Sparkles="\083\112\097\114\107\108\101\115",Model="\077\111\100\101\108",Folder="\070\111\108\100\101\114"}function Serialization.SerializeModel(V)local b={}for V,s in ipairs(V)do table.insert(b,j[s.ClassName]and s or nil)end V=b local v=s.FlipTable(V)local Z={}Z.Version=3 Z.Items={}for V,b in pairs(V)do if b:IsA("\066\097\115\101\080\097\114\116")then local C={}C[1]=j[b.ClassName]C[2]=v[b.Parent]or 0 C[3]=b.Name==l[b.ClassName]and""or b.Name C[4]=b.Size.X C[5]=b.Size.Y C[6]=b.Size.Z s.ConcatTable(C,{b.CFrame:components()})C[19]=b.Color.r C[20]=b.Color.g C[21]=b.Color.b C[22]=b.Material.Value C[23]=b.Anchored and 1 or 0 C[24]=b.CanCollide and 1 or 0 C[25]=b.Reflectance C[26]=b.Transparency C[27]=b.TopSurface.Value C[28]=b.BottomSurface.Value C[29]=b.FrontSurface.Value C[30]=b.BackSurface.Value C[31]=b.LeftSurface.Value C[32]=b.RightSurface.Value Z.Items[V]=C end if b.ClassName=="\080\097\114\116"then local s=Z.Items[V]s[33]=b.Shape.Value end if b.ClassName=="\086\101\104\105\099\108\101\083\101\097\116"then local s=Z.Items[V]s[33]=b.MaxSpeed s[34]=b.Torque s[35]=b.TurnSpeed end if b.ClassName=="\084\114\117\115\115\080\097\114\116"then local s=Z.Items[V]s[33]=b.Style.Value end if b.ClassName=="\083\112\101\099\105\097\108\077\101\115\104"then local s={}s[1]=j[b.ClassName]s[2]=v[b.Parent]or 0 s[3]=b.Name==l[b.ClassName]and""or b.Name s[4]=b.MeshType.Value s[5]=b.MeshId s[6]=b.TextureId s[7]=b.Offset.X s[8]=b.Offset.Y s[9]=b.Offset.Z s[10]=b.Scale.X s[11]=b.Scale.Y s[12]=b.Scale.Z s[13]=b.VertexColor.X s[14]=b.VertexColor.Y s[15]=b.VertexColor.Z Z.Items[V]=s end if b:IsA("\068\101\099\097\108")then local s={}s[1]=j[b.ClassName]s[2]=v[b.Parent]or 0 s[3]=b.Name==l[b.ClassName]and""or b.Name s[4]=b.Texture s[5]=b.Transparency s[6]=b.Face.Value Z.Items[V]=s end if b.ClassName=="\084\101\120\116\117\114\101"then local s=Z.Items[V]s[7]=b.StudsPerTileU s[8]=b.StudsPerTileV end if b:IsA("\076\105\103\104\116")then local s={}s[1]=j[b.ClassName]s[2]=v[b.Parent]or 0 s[3]=b.Name==l[b.ClassName]and""or b.Name s[4]=b.Brightness s[5]=b.Color.r s[6]=b.Color.g s[7]=b.Color.b s[8]=b.Enabled and 1 or 0 s[9]=b.Shadows and 1 or 0 Z.Items[V]=s end if b.ClassName=="\080\111\105\110\116\076\105\103\104\116"then local s=Z.Items[V]s[10]=b.Range end if b.ClassName=="\083\112\111\116\076\105\103\104\116"then local s=Z.Items[V]s[10]=b.Range s[11]=b.Angle s[12]=b.Face.Value end if b.ClassName=="\083\117\114\102\097\099\101\076\105\103\104\116"then local s=Z.Items[V]s[10]=b.Range s[11]=b.Angle s[12]=b.Face.Value end if b.ClassName=="\083\109\111\107\101"then local s={}s[1]=j[b.ClassName]s[2]=v[b.Parent]or 0 s[3]=b.Name==l[b.ClassName]and""or b.Name s[4]=b.Enabled and 1 or 0 s[5]=b.Color.r s[6]=b.Color.g s[7]=b.Color.b s[8]=b.Size s[9]=b.RiseVelocity s[10]=b.Opacity Z.Items[V]=s end if b.ClassName=="\070\105\114\101"then local s={}s[1]=j[b.ClassName]s[2]=v[b.Parent]or 0 s[3]=b.Name==l[b.ClassName]and""or b.Name s[4]=b.Enabled and 1 or 0 s[5]=b.Color.r s[6]=b.Color.g s[7]=b.Color.b s[8]=b.SecondaryColor.r s[9]=b.SecondaryColor.g s[10]=b.SecondaryColor.b s[11]=b.Heat s[12]=b.Size Z.Items[V]=s end if b.ClassName=="\083\112\097\114\107\108\101\115"then local s={}s[1]=j[b.ClassName]s[2]=v[b.Parent]or 0 s[3]=b.Name==l[b.ClassName]and""or b.Name s[4]=b.Enabled and 1 or 0 s[5]=b.SparkleColor.r s[6]=b.SparkleColor.g s[7]=b.SparkleColor.b Z.Items[V]=s end if b.ClassName=="\077\111\100\101\108"then local s={}s[1]=j[b.ClassName]s[2]=v[b.Parent]or 0 s[3]=b.Name==l[b.ClassName]and""or b.Name s[4]=b.PrimaryPart and v[b.PrimaryPart]or 0 Z.Items[V]=s end if b.ClassName=="\070\111\108\100\101\114"then local s={}s[1]=j[b.ClassName]s[2]=v[b.Parent]or 0 s[3]=b.Name==l[b.ClassName]and""or b.Name Z.Items[V]=s end if V%100==0 then wait(.01)end end return HttpService:JSONEncode(Z)end function Serialization.InflateBuildData(V)local b={}local v={}for V,l in ipairs(V.Items)do if l[1]==j.Part or l[1]==j.WedgePart or l[1]==j.CornerWedgePart or l[1]==j.VehicleSeat or l[1]==j.Seat or l[1]==j.TrussPart then local b=Instance.new(s.FindTableOccurrence(j,l[1]))b.Size=Vector3.new(unpack(s.Slice(l,4,6)))b.CFrame=CFrame.new(unpack(s.Slice(l,7,18)))b.Color=Color3.new(l[19],l[20],l[21])b.Material=l[22]b.Anchored=l[23]==1 b.CanCollide=l[24]==1 b.Reflectance=l[25]b.Transparency=l[26]b.TopSurface=l[27]b.BottomSurface=l[28]b.FrontSurface=l[29]b.BackSurface=l[30]b.LeftSurface=l[31]b.RightSurface=l[32]v[V]=b end if l[1]==j.Part then local s=v[V]s.Shape=l[33]end if l[1]==j.VehicleSeat then local s=v[V]s.MaxSpeed=l[33]s.Torque=l[34]s.TurnSpeed=l[35]end if l[1]==j.TrussPart then local s=v[V]s.Style=l[33]end if l[1]==j.SpecialMesh then local j=Instance.new("\083\112\101\099\105\097\108\077\101\115\104")j.MeshType=l[4]j.MeshId=l[5]j.TextureId=l[6]j.Offset=Vector3.new(unpack(s.Slice(l,7,9)))j.Scale=Vector3.new(unpack(s.Slice(l,10,12)))j.VertexColor=Vector3.new(unpack(s.Slice(l,13,15)))v[V]=j end if l[1]==j.Decal or l[1]==j.Texture then local b=Instance.new(s.FindTableOccurrence(j,l[1]))b.Texture=l[4]b.Transparency=l[5]b.Face=l[6]v[V]=b end if l[1]==j.Texture then local s=v[V]s.StudsPerTileU=l[7]s.StudsPerTileV=l[8]end if l[1]==j.PointLight or l[1]==j.SpotLight or l[1]==j.SurfaceLight then local b=Instance.new(s.FindTableOccurrence(j,l[1]))b.Brightness=l[4]b.Color=Color3.new(unpack(s.Slice(l,5,7)))b.Enabled=l[8]==1 b.Shadows=l[9]==1 v[V]=b end if l[1]==j.PointLight then local s=v[V]s.Range=l[10]end if l[1]==j.SpotLight then local s=v[V]s.Range=l[10]s.Angle=l[11]s.Face=l[12]end if l[1]==j.SurfaceLight then local s=v[V]s.Range=l[10]s.Angle=l[11]s.Face=l[12]end if l[1]==j.Smoke then local j=Instance.new("\083\109\111\107\101")j.Enabled=l[4]==1 j.Color=Color3.new(unpack(s.Slice(l,5,7)))j.Size=l[8]j.RiseVelocity=l[9]j.Opacity=l[10]v[V]=j end if l[1]==j.Fire then local j=Instance.new("\070\105\114\101")j.Enabled=l[4]==1 j.Color=Color3.new(unpack(s.Slice(l,5,7)))j.SecondaryColor=Color3.new(unpack(s.Slice(l,8,10)))j.Heat=l[11]j.Size=l[12]v[V]=j end if l[1]==j.Sparkles then local j=Instance.new("\083\112\097\114\107\108\101\115")j.Enabled=l[4]==1 j.SparkleColor=Color3.new(unpack(s.Slice(l,5,7)))v[V]=j end if l[1]==j.Model then local s=Instance.new("\077\111\100\101\108")v[V]=s end if l[1]==j.Folder then local s=Instance.new("\070\111\108\100\101\114")v[V]=s end end for V,s in pairs(V.Items)do local j=v[V]if j and s[1]<=18 then j.Name=s[3]==""and l[j.ClassName]or s[3]if s[2]==0 then table.insert(b,j)else j.Parent=v[s[2]]end end if j and s[1]==15 then j.PrimaryPart=s[4]~=0 and v[s[4]]or nil end end return b end

local Tool = script.Parent.Parent
local Support = require(Tool.Libraries.SupportLibrary);
Support.ImportServices();

local Types = {
	Part = 0,
	WedgePart = 1,
	CornerWedgePart = 2,
	VehicleSeat = 3,
	Seat = 4,
	TrussPart = 5,
	SpecialMesh = 6,
	Texture = 7,
	Decal = 8,
	PointLight = 9,
	SpotLight = 10,
	SurfaceLight = 11,
	Smoke = 12,
	Fire = 13,
	Sparkles = 14,
	Model = 15,
	Folder = 18
};

local DefaultNames = {
	Part = 'Part',
	WedgePart = 'Wedge',
	CornerWedgePart = 'CornerWedge',
	VehicleSeat = 'VehicleSeat',
	Seat = 'Seat',
	TrussPart = 'Truss',
	SpecialMesh = 'Mesh',
	Texture = 'Texture',
	Decal = 'Decal',
	PointLight = 'PointLight',
	SpotLight = 'SpotLight',
	SurfaceLight = 'SurfaceLight',
	Smoke = 'Smoke',
	Fire = 'Fire',
	Sparkles = 'Sparkles',
	Model = 'Model',
	Folder = 'Folder'
};

function Serialization.SerializeModel(Items)
	-- Returns a serialized version of the given model

	-- Filter out non-serializable items in `Items`
	local SerializableItems = {};
	for Index, Item in ipairs(Items) do
		table.insert(SerializableItems, Types[Item.ClassName] and Item or nil);
	end;
	Items = SerializableItems;

	-- Get a snapshot of the content
	local Keys = Support.FlipTable(Items);

	local Data = {};
	Data.Version = 3;
	Data.Items = {};

	-- Serialize each item in the model
	for Index, Item in pairs(Items) do

		if Item:IsA 'BasePart' then
			local Datum = {};
			Datum[1] = Types[Item.ClassName];
			Datum[2] = Keys[Item.Parent] or 0;
			Datum[3] = Item.Name == DefaultNames[Item.ClassName] and '' or Item.Name;
			Datum[4] = Item.Size.X;
			Datum[5] = Item.Size.Y;
			Datum[6] = Item.Size.Z;
			Support.ConcatTable(Datum, { Item.CFrame:components() });
			Datum[19] = Item.Color.r;
			Datum[20] = Item.Color.g;
			Datum[21] = Item.Color.b;
			Datum[22] = Item.Material.Value;
			Datum[23] = Item.Anchored and 1 or 0;
			Datum[24] = Item.CanCollide and 1 or 0;
			Datum[25] = Item.Reflectance;
			Datum[26] = Item.Transparency;
			Datum[27] = Item.TopSurface.Value;
			Datum[28] = Item.BottomSurface.Value;
			Datum[29] = Item.FrontSurface.Value;
			Datum[30] = Item.BackSurface.Value;
			Datum[31] = Item.LeftSurface.Value;
			Datum[32] = Item.RightSurface.Value;
			Data.Items[Index] = Datum;
		end;

		if Item.ClassName == 'Part' then
			local Datum = Data.Items[Index];
			Datum[33] = Item.Shape.Value;
		end;

		if Item.ClassName == 'VehicleSeat' then
			local Datum = Data.Items[Index];
			Datum[33] = Item.MaxSpeed;
			Datum[34] = Item.Torque;
			Datum[35] = Item.TurnSpeed;
		end;

		if Item.ClassName == 'TrussPart' then
			local Datum = Data.Items[Index];
			Datum[33] = Item.Style.Value;
		end;

		if Item.ClassName == 'SpecialMesh' then
			local Datum = {};
			Datum[1] = Types[Item.ClassName];
			Datum[2] = Keys[Item.Parent] or 0;
			Datum[3] = Item.Name == DefaultNames[Item.ClassName] and '' or Item.Name;
			Datum[4] = Item.MeshType.Value;
			Datum[5] = Item.MeshId;
			Datum[6] = Item.TextureId;
			Datum[7] = Item.Offset.X;
			Datum[8] = Item.Offset.Y;
			Datum[9] = Item.Offset.Z;
			Datum[10] = Item.Scale.X;
			Datum[11] = Item.Scale.Y;
			Datum[12] = Item.Scale.Z;
			Datum[13] = Item.VertexColor.X;
			Datum[14] = Item.VertexColor.Y;
			Datum[15] = Item.VertexColor.Z;
			Data.Items[Index] = Datum;
		end;

		if Item:IsA 'Decal' then
			local Datum = {};
			Datum[1] = Types[Item.ClassName];
			Datum[2] = Keys[Item.Parent] or 0;
			Datum[3] = Item.Name == DefaultNames[Item.ClassName] and '' or Item.Name;
			Datum[4] = Item.Texture;
			Datum[5] = Item.Transparency;
			Datum[6] = Item.Face.Value;
			Data.Items[Index] = Datum;
		end;

		if Item.ClassName == 'Texture' then
			local Datum = Data.Items[Index];
			Datum[7] = Item.StudsPerTileU;
			Datum[8] = Item.StudsPerTileV;
		end;

		if Item:IsA 'Light' then
			local Datum = {};
			Datum[1] = Types[Item.ClassName];
			Datum[2] = Keys[Item.Parent] or 0;
			Datum[3] = Item.Name == DefaultNames[Item.ClassName] and '' or Item.Name;
			Datum[4] = Item.Brightness;
			Datum[5] = Item.Color.r;
			Datum[6] = Item.Color.g;
			Datum[7] = Item.Color.b;
			Datum[8] = Item.Enabled and 1 or 0;
			Datum[9] = Item.Shadows and 1 or 0;
			Data.Items[Index] = Datum;
		end;

		if Item.ClassName == 'PointLight' then
			local Datum = Data.Items[Index];
			Datum[10] = Item.Range;
		end;

		if Item.ClassName == 'SpotLight' then
			local Datum = Data.Items[Index];
			Datum[10] = Item.Range;
			Datum[11] = Item.Angle;
			Datum[12] = Item.Face.Value;
		end;

		if Item.ClassName == 'SurfaceLight' then
			local Datum = Data.Items[Index];
			Datum[10] = Item.Range;
			Datum[11] = Item.Angle;
			Datum[12] = Item.Face.Value;
		end;

		if Item.ClassName == 'Smoke' then
			local Datum = {};
			Datum[1] = Types[Item.ClassName];
			Datum[2] = Keys[Item.Parent] or 0;
			Datum[3] = Item.Name == DefaultNames[Item.ClassName] and '' or Item.Name;
			Datum[4] = Item.Enabled and 1 or 0;
			Datum[5] = Item.Color.r;
			Datum[6] = Item.Color.g;
			Datum[7] = Item.Color.b;
			Datum[8] = Item.Size;
			Datum[9] = Item.RiseVelocity;
			Datum[10] = Item.Opacity;
			Data.Items[Index] = Datum;
		end;

		if Item.ClassName == 'Fire' then
			local Datum = {};
			Datum[1] = Types[Item.ClassName];
			Datum[2] = Keys[Item.Parent] or 0;
			Datum[3] = Item.Name == DefaultNames[Item.ClassName] and '' or Item.Name;
			Datum[4] = Item.Enabled and 1 or 0;
			Datum[5] = Item.Color.r;
			Datum[6] = Item.Color.g;
			Datum[7] = Item.Color.b;
			Datum[8] = Item.SecondaryColor.r;
			Datum[9] = Item.SecondaryColor.g;
			Datum[10] = Item.SecondaryColor.b;
			Datum[11] = Item.Heat;
			Datum[12] = Item.Size;
			Data.Items[Index] = Datum;
		end;

		if Item.ClassName == 'Sparkles' then
			local Datum = {};
			Datum[1] = Types[Item.ClassName];
			Datum[2] = Keys[Item.Parent] or 0;
			Datum[3] = Item.Name == DefaultNames[Item.ClassName] and '' or Item.Name;
			Datum[4] = Item.Enabled and 1 or 0;
			Datum[5] = Item.SparkleColor.r;
			Datum[6] = Item.SparkleColor.g;
			Datum[7] = Item.SparkleColor.b;
			Data.Items[Index] = Datum;
		end;

		if Item.ClassName == 'Model' then
			local Datum = {};
			Datum[1] = Types[Item.ClassName];
			Datum[2] = Keys[Item.Parent] or 0;
			Datum[3] = Item.Name == DefaultNames[Item.ClassName] and '' or Item.Name;
			Datum[4] = Item.PrimaryPart and Keys[Item.PrimaryPart] or 0;
			Data.Items[Index] = Datum;
		end;

		if Item.ClassName == 'Folder' then
			local Datum = {}
			Datum[1] = Types[Item.ClassName]
			Datum[2] = Keys[Item.Parent] or 0
			Datum[3] = Item.Name == DefaultNames[Item.ClassName] and '' or Item.Name
			Data.Items[Index] = Datum
		end

		-- Spread the workload over time to avoid locking up the CPU
		if Index % 100 == 0 then
			wait(0.01);
		end;

	end;

	-- Return the serialized data
	return HttpService:JSONEncode(Data);

end;

function Serialization.InflateBuildData(Data)
	-- Returns an inflated version of the given build data

	local Build = {};
	local Instances = {};

	-- Create each instance
	for Index, Datum in ipairs(Data.Items) do

		-- Inflate BaseParts
		if Datum[1] == Types.Part
			or Datum[1] == Types.WedgePart
			or Datum[1] == Types.CornerWedgePart
			or Datum[1] == Types.VehicleSeat
			or Datum[1] == Types.Seat
			or Datum[1] == Types.TrussPart
		then
			local Item = Instance.new(Support.FindTableOccurrence(Types, Datum[1]));
			Item.Size = Vector3.new(unpack(Support.Slice(Datum, 4, 6)));
			Item.CFrame = CFrame.new(unpack(Support.Slice(Datum, 7, 18)));
			Item.Color = Color3.new(Datum[19], Datum[20], Datum[21]);
			Item.Material = Datum[22];
			Item.Anchored = Datum[23] == 1;
			Item.CanCollide = Datum[24] == 1;
			Item.Reflectance = Datum[25];
			Item.Transparency = Datum[26];
			Item.TopSurface = Datum[27];
			Item.BottomSurface = Datum[28];
			Item.FrontSurface = Datum[29];
			Item.BackSurface = Datum[30];
			Item.LeftSurface = Datum[31];
			Item.RightSurface = Datum[32];

			-- Register the part
			Instances[Index] = Item;
		end;

		-- Inflate specific Part properties
		if Datum[1] == Types.Part then
			local Item = Instances[Index];
			Item.Shape = Datum[33];
		end;

		-- Inflate specific VehicleSeat properties
		if Datum[1] == Types.VehicleSeat then
			local Item = Instances[Index];
			Item.MaxSpeed = Datum[33];
			Item.Torque = Datum[34];
			Item.TurnSpeed = Datum[35];
		end;

		-- Inflate specific TrussPart properties
		if Datum[1] == Types.TrussPart then
			local Item = Instances[Index];
			Item.Style = Datum[33];
		end;

		-- Inflate SpecialMesh instances
		if Datum[1] == Types.SpecialMesh then
			local Item = Instance.new('SpecialMesh');
			Item.MeshType = Datum[4];
			Item.MeshId = Datum[5];
			Item.TextureId = Datum[6];
			Item.Offset = Vector3.new(unpack(Support.Slice(Datum, 7, 9)));
			Item.Scale = Vector3.new(unpack(Support.Slice(Datum, 10, 12)));
			Item.VertexColor = Vector3.new(unpack(Support.Slice(Datum, 13, 15)));

			-- Register the mesh
			Instances[Index] = Item;
		end;

		-- Inflate Decal instances
		if Datum[1] == Types.Decal or Datum[1] == Types.Texture then
			local Item = Instance.new(Support.FindTableOccurrence(Types, Datum[1]));
			Item.Texture = Datum[4];
			Item.Transparency = Datum[5];
			Item.Face = Datum[6];

			-- Register the Decal
			Instances[Index] = Item;
		end;

		-- Inflate specific Texture properties
		if Datum[1] == Types.Texture then
			local Item = Instances[Index];
			Item.StudsPerTileU = Datum[7];
			Item.StudsPerTileV = Datum[8];
		end;

		-- Inflate Light instances
		if Datum[1] == Types.PointLight
			or Datum[1] == Types.SpotLight
			or Datum[1] == Types.SurfaceLight
		then
			local Item = Instance.new(Support.FindTableOccurrence(Types, Datum[1]));
			Item.Brightness = Datum[4];
			Item.Color = Color3.new(unpack(Support.Slice(Datum, 5, 7)));
			Item.Enabled = Datum[8] == 1;
			Item.Shadows = Datum[9] == 1;

			-- Register the light
			Instances[Index] = Item;
		end;

		-- Inflate specific PointLight properties
		if Datum[1] == Types.PointLight then
			local Item = Instances[Index];
			Item.Range = Datum[10];
		end;

		-- Inflate specific SpotLight properties
		if Datum[1] == Types.SpotLight then
			local Item = Instances[Index];
			Item.Range = Datum[10];
			Item.Angle = Datum[11];
			Item.Face = Datum[12];
		end;

		-- Inflate specific SurfaceLight properties
		if Datum[1] == Types.SurfaceLight then
			local Item = Instances[Index];
			Item.Range = Datum[10];
			Item.Angle = Datum[11];
			Item.Face = Datum[12];
		end;

		-- Inflate Smoke instances
		if Datum[1] == Types.Smoke then
			local Item = Instance.new('Smoke');
			Item.Enabled = Datum[4] == 1;
			Item.Color = Color3.new(unpack(Support.Slice(Datum, 5, 7)));
			Item.Size = Datum[8];
			Item.RiseVelocity = Datum[9];
			Item.Opacity = Datum[10];

			-- Register the smoke
			Instances[Index] = Item;
		end;

		-- Inflate Fire instances
		if Datum[1] == Types.Fire then
			local Item = Instance.new('Fire');
			Item.Enabled = Datum[4] == 1;
			Item.Color = Color3.new(unpack(Support.Slice(Datum, 5, 7)));
			Item.SecondaryColor = Color3.new(unpack(Support.Slice(Datum, 8, 10)));
			Item.Heat = Datum[11];
			Item.Size = Datum[12];

			-- Register the fire
			Instances[Index] = Item;
		end;

		-- Inflate Sparkles instances
		if Datum[1] == Types.Sparkles then
			local Item = Instance.new('Sparkles');
			Item.Enabled = Datum[4] == 1;
			Item.SparkleColor = Color3.new(unpack(Support.Slice(Datum, 5, 7)));

			-- Register the instance
			Instances[Index] = Item;
		end;

		-- Inflate Model instances
		if Datum[1] == Types.Model then
			local Item = Instance.new('Model');

			-- Register the model
			Instances[Index] = Item;
		end;

		-- Inflate Folder instances
		if Datum[1] == Types.Folder then
			local Item = Instance.new('Folder')

			-- Register the folder
			Instances[Index] = Item
		end

	end;

	-- Set object values on each instance
	for Index, Datum in pairs(Data.Items) do

		-- Get the item's instance
		local Item = Instances[Index];

		-- Set each item's parent and name
		if Item and Datum[1] <= 18 then
			Item.Name = (Datum[3] == '') and DefaultNames[Item.ClassName] or Datum[3];
			if Datum[2] == 0 then
				table.insert(Build, Item);
			else
				Item.Parent = Instances[Datum[2]];
			end;
		end;

		-- Set model primary parts
		if Item and Datum[1] == 15 then
			Item.PrimaryPart = (Datum[4] ~= 0) and Instances[Datum[4]] or nil;
		end;

	end;

	-- Return the model
	return Build;

end;
