Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Converted using Mokiros's Model to Script plugin
- -- Converted string size: 945
- local Part_Classes = {"Part","WedgePart","CornerWedgePart"}
- local Part_Shapes = {"Brick","Cylinder","Sphere","Torso","Wedge"}
- local function DecodeUnion(t)
- local r = function()return table.remove(t,1) end
- local split = function(str,sep)
- local fields = {}
- str:gsub(("([^%s]+)"):format(sep or ','),function(c)fields[#fields+1]=c end)
- return fields
- end
- local m = Instance.new("Folder")
- m.Name = "UnionCache ["..tostring(math.random(1,9999)).."]"
- m.Archivable = false
- m.Parent = game:GetService("ServerStorage")
- local Union,Subtract = {},{}
- repeat
- local isNegate = false
- local class = r()
- if class=='-' then
- isNegate = true
- class = r()
- end
- if class=='n' then
- local d = {}
- local a = r()
- repeat
- table.insert(d,a)
- a = r()
- until a=='p'
- local u = DecodeUnion(d)
- if u then
- table.insert(isNegate and Subtract or Union,u)
- end
- else
- local size,pos,rot = Vector3.new(unpack(split(r()))),Vector3.new(unpack(split(r()))),Vector3.new(unpack(split(r())))
- local part = Instance.new(Part_Classes[tonumber(class)])
- part.Size = size
- part.Position = pos
- part.Orientation = rot
- if r()=="+" then
- local m,ms = r(),Vector3.new(unpack(split(r())))
- if tonumber(m)==6 then
- part.Shape = Enum.PartType.Cylinder
- elseif tonumber(m)==7 then
- part.Shape = Enum.PartType.Ball
- else
- local mesh = Instance.new(tonumber(m)==8 and "CylinderMesh" or "SpecialMesh")
- if tonumber(m)~=8 then
- mesh.MeshType = Enum.MeshType[Part_Shapes[tonumber(m)]]
- end
- mesh.Scale = ms
- mesh.Parent = part
- end
- end
- table.insert(isNegate and Subtract or Union,part)
- end
- until #t<=0
- local first = Union[1]
- first.Parent = m
- if #Union>1 then
- first = first:UnionAsync(Union)
- first.Parent = m
- end
- if #Subtract>0 then
- first = first:SubtractAsync(Subtract)
- first.Parent = m
- end
- first.Parent = nil
- m:Destroy()
- return first
- end
- local Decode = function(str,t,props,classes,values,ICList,Model,CurPar,LastIns,split,RemoveAndSplit,InstanceList)
- local tonum,table_remove,inst,parnt,comma,table_foreach = tonumber,table.remove,Instance.new,"Parent",",",
- function(t,f)
- for a,b in pairs(t) do
- f(a,b)
- end
- end
- local Types = {
- Color3 = Color3.new,
- Vector3 = Vector3.new,
- Vector2 = Vector2.new,
- UDim = UDim.new,
- UDim2 = UDim2.new,
- CFrame = CFrame.new,
- Rect = Rect.new,
- NumberRange = NumberRange.new,
- NumberSequence = function(...)
- local a = {...}
- local t = {}
- repeat
- t[#t+1] = NumberSequenceKeypoint.new(table_remove(a,1),table_remove(a,1),table_remove(a,1))
- until #a==0
- return NumberSequence.new(t)
- end,
- ColorSequence = function(...)
- local a = {...}
- local t = {}
- repeat
- t[#t+1] = ColorSequenceKeypoint.new(table_remove(a,1),Color3.new(table_remove(a,1),table_remove(a,1),table_remove(a,1)))
- until #a==0
- return ColorSequence.new(t)
- end,
- number = tonumber,
- boolean = function(a)
- return a=="1"
- end
- }
- split = function(str,sep)
- if not str then return end
- local fields = {}
- local ConcatNext = false
- str:gsub(("([^%s]+)"):format(sep),function(c)
- if ConcatNext == true then
- fields[#fields] = fields[#fields]..sep..c
- ConcatNext = false
- else
- fields[#fields+1] = c
- end
- if c:sub(#c)=="\\" then
- c = fields[#fields]
- fields[#fields] = c:sub(1,#c-1)
- ConcatNext = true
- end
- end)
- return fields
- end
- RemoveAndSplit = function(t)
- return split(table_remove(t,1),comma)
- end
- t = split(str,";")
- props = RemoveAndSplit(t)
- classes = RemoveAndSplit(t)
- values = split(table_remove(t,1),'|')
- ICList = RemoveAndSplit(t)
- InstanceList = {}
- Model = inst"Model"
- CurPar = Model
- table_foreach(t,function(ct,c)
- if c=="n" or c=="p" then
- CurPar = c=="n" and LastIns or CurPar[parnt]
- else
- ct = split(c,"|")
- local class = classes[tonum(table_remove(ct,1))]
- if class=="UnionOperation" then
- LastIns = {Locked="true",Anchored="true",UsePartColor="true"}
- else
- LastIns = inst(class)
- if LastIns:IsA"Script" then
- s(LastIns)
- end
- end
- local function SetProperty(LastIns,p,str,s)
- s = Types[typeof(LastIns[p])]
- LastIns[p] = s and s(unpack(split(str,comma))) or str
- end
- local UnionData
- table_foreach(ct,function(s,p,a,str)
- a = p:find":"
- p,str = props[tonum(p:sub(1,a-1))],values[tonum(p:sub(a+1))]
- if p=="UnionData" then
- UnionData = split(str," ")
- return
- end
- if class=="UnionOperation" then
- LastIns[p] = str
- return
- end
- SetProperty(LastIns,p,str)
- end)
- if UnionData then
- local LI_Data = LastIns
- LastIns = DecodeUnion(UnionData)
- table_foreach(LI_Data,function(p,str)
- SetProperty(LastIns,p,str)
- end)
- end
- table.insert(InstanceList,LastIns)
- LastIns[parnt] = CurPar
- end
- end)
- table_remove(ICList,1)
- table_foreach(ICList,function(a,b)
- b = split(b,">")
- InstanceList[tonum(b[1])][props[tonum(b[2])]] = InstanceList[tonum(b[3])]
- end)
- return Model:GetChildren()
- end
- local Objects = Decode('Name,Anchored,Material,Position,Orientation,Size,Shape,BottomSurface,TopSurface,Face,Range,Color,UnionData;Part,Model,SurfaceLight,UnionOperation;Part|escape pod|1|288|43.2,39.255,33.4|0,90,-90|0.39,1'
- ..'.84,1.84|2|0|50.832|0.972,0.972,0.972|816|43.2,16.55,32.4|0,-180,-90|1,34,40|Main|1088|1 4,13.333,14.666 42.7,24.05,14.4 0,90,0 + 6 1,1,1 - 1 1,13.333,12.666 42.7,24.05,12.9 0,90,0 + 6 1,1,1 - 1 1,13.'
- ..'333,12.666 42.7,24.05,15.9 0,90,0 + 6 1,1,1|1056|- 1 36,36,36 43.211,24.05,33.418 0,0,0 + 7 1,1,1 - 1 20,13.333,14.666 42.7,24.05,15.399 0,90,0 + 6 1,1,1 1 46,46,46 43.2,23.05,33.399 0,0,0 + 7 1,1,1|0'
- ..'.639,0.635,0.647|- 1 1.84,1.694,1.694 43.2,38.97,33.4 0,90,-90 + 6 1,1,1 1 3,2,2 43.2,40.55,33.4 0,90,-90 + 6 1,1,1;0;2|1:2;n;1|2:3|3:4|4:5|5:6|6:7|7:8|8:9|9:9;n;3|10:9|11:10;p;1|2:3|12:11|3:12|4:13|5'
- ..':14|6:15|7:8|8:9|9:9|12:11|12:11;4|1:16|2:3|12:11|3:17|12:11|12:11|13:18;4|2:3|12:11|3:19|12:11|12:11|13:20;4|2:3|12:21|3:17|12:21|12:21|13:22;p;')
- for _,Object in pairs(Objects) do
- Object.Parent = script and script.Parent==workspace and script or workspace
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement