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