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

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

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

		if Item.ClassName == 'TrussPart' then
			local Datum = Data.Items[Index];
			Datum[31] = 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[6] = Item.StudsPerTileU;
			Datum[7] = 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.BrickColor = BrickColor.new(Datum[19]);
			Item.Material = Datum[20];
			Item.Anchored = Datum[21] == 1;
			Item.CanCollide = Datum[22] == 1;
			Item.Reflectance = Datum[23];
			Item.Transparency = Datum[24];
			Item.TopSurface = Datum[25];
			Item.BottomSurface = Datum[26];
			Item.FrontSurface = Datum[27];
			Item.BackSurface = Datum[28];
			Item.LeftSurface = Datum[29];
			Item.RightSurface = Datum[30];

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

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

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

		-- Inflate specific TrussPart properties
		if Datum[1] == Types.TrussPart then
			local Item = Instances[Index];
			Item.Style = Datum[31];
		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;
