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

Support = require(script.Parent.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
};

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'
};

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;

		-- 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;

	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] <= 15 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;
