Advertisement
AxeuerAlt

Untitled

Jun 23rd, 2019
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.39 KB | None | 0 0
  1. -- Converted using Mokiros's Model to Script plugin
  2. -- Converted string size: 945
  3.  
  4.  
  5. local Part_Classes = {"Part","WedgePart","CornerWedgePart"}
  6. local Part_Shapes = {"Brick","Cylinder","Sphere","Torso","Wedge"}
  7. local function DecodeUnion(t)
  8. local r = function()return table.remove(t,1) end
  9. local split = function(str,sep)
  10. local fields = {}
  11. str:gsub(("([^%s]+)"):format(sep or ','),function(c)fields[#fields+1]=c end)
  12. return fields
  13. end
  14. local m = Instance.new("Folder")
  15. m.Name = "UnionCache ["..tostring(math.random(1,9999)).."]"
  16. m.Archivable = false
  17. m.Parent = game:GetService("ServerStorage")
  18. local Union,Subtract = {},{}
  19. repeat
  20. local isNegate = false
  21. local class = r()
  22. if class=='-' then
  23. isNegate = true
  24. class = r()
  25. end
  26. if class=='n' then
  27. local d = {}
  28. local a = r()
  29. repeat
  30. table.insert(d,a)
  31. a = r()
  32. until a=='p'
  33. local u = DecodeUnion(d)
  34. if u then
  35. table.insert(isNegate and Subtract or Union,u)
  36. end
  37. else
  38. local size,pos,rot = Vector3.new(unpack(split(r()))),Vector3.new(unpack(split(r()))),Vector3.new(unpack(split(r())))
  39. local part = Instance.new(Part_Classes[tonumber(class)])
  40. part.Size = size
  41. part.Position = pos
  42. part.Orientation = rot
  43. if r()=="+" then
  44. local m,ms = r(),Vector3.new(unpack(split(r())))
  45. if tonumber(m)==6 then
  46. part.Shape = Enum.PartType.Cylinder
  47. elseif tonumber(m)==7 then
  48. part.Shape = Enum.PartType.Ball
  49. else
  50. local mesh = Instance.new(tonumber(m)==8 and "CylinderMesh" or "SpecialMesh")
  51. if tonumber(m)~=8 then
  52. mesh.MeshType = Enum.MeshType[Part_Shapes[tonumber(m)]]
  53. end
  54. mesh.Scale = ms
  55. mesh.Parent = part
  56. end
  57. end
  58. table.insert(isNegate and Subtract or Union,part)
  59. end
  60. until #t<=0
  61. local first = Union[1]
  62. first.Parent = m
  63. if #Union>1 then
  64. first = first:UnionAsync(Union)
  65. first.Parent = m
  66. end
  67. if #Subtract>0 then
  68. first = first:SubtractAsync(Subtract)
  69. first.Parent = m
  70. end
  71. first.Parent = nil
  72. m:Destroy()
  73. return first
  74. end
  75. local Decode = function(str,t,props,classes,values,ICList,Model,CurPar,LastIns,split,RemoveAndSplit,InstanceList)
  76. local tonum,table_remove,inst,parnt,comma,table_foreach = tonumber,table.remove,Instance.new,"Parent",",",
  77. function(t,f)
  78. for a,b in pairs(t) do
  79. f(a,b)
  80. end
  81. end
  82. local Types = {
  83. Color3 = Color3.new,
  84. Vector3 = Vector3.new,
  85. Vector2 = Vector2.new,
  86. UDim = UDim.new,
  87. UDim2 = UDim2.new,
  88. CFrame = CFrame.new,
  89. Rect = Rect.new,
  90. NumberRange = NumberRange.new,
  91. NumberSequence = function(...)
  92. local a = {...}
  93. local t = {}
  94. repeat
  95. t[#t+1] = NumberSequenceKeypoint.new(table_remove(a,1),table_remove(a,1),table_remove(a,1))
  96. until #a==0
  97. return NumberSequence.new(t)
  98. end,
  99. ColorSequence = function(...)
  100. local a = {...}
  101. local t = {}
  102. repeat
  103. t[#t+1] = ColorSequenceKeypoint.new(table_remove(a,1),Color3.new(table_remove(a,1),table_remove(a,1),table_remove(a,1)))
  104. until #a==0
  105. return ColorSequence.new(t)
  106. end,
  107. number = tonumber,
  108. boolean = function(a)
  109. return a=="1"
  110. end
  111. }
  112. split = function(str,sep)
  113. if not str then return end
  114. local fields = {}
  115. local ConcatNext = false
  116. str:gsub(("([^%s]+)"):format(sep),function(c)
  117. if ConcatNext == true then
  118. fields[#fields] = fields[#fields]..sep..c
  119. ConcatNext = false
  120. else
  121. fields[#fields+1] = c
  122. end
  123. if c:sub(#c)=="\\" then
  124. c = fields[#fields]
  125. fields[#fields] = c:sub(1,#c-1)
  126. ConcatNext = true
  127. end
  128. end)
  129. return fields
  130. end
  131. RemoveAndSplit = function(t)
  132. return split(table_remove(t,1),comma)
  133. end
  134. t = split(str,";")
  135. props = RemoveAndSplit(t)
  136. classes = RemoveAndSplit(t)
  137. values = split(table_remove(t,1),'|')
  138. ICList = RemoveAndSplit(t)
  139. InstanceList = {}
  140. Model = inst"Model"
  141. CurPar = Model
  142. table_foreach(t,function(ct,c)
  143. if c=="n" or c=="p" then
  144. CurPar = c=="n" and LastIns or CurPar[parnt]
  145. else
  146. ct = split(c,"|")
  147. local class = classes[tonum(table_remove(ct,1))]
  148. if class=="UnionOperation" then
  149. LastIns = {Locked="true",Anchored="true",UsePartColor="true"}
  150. else
  151. LastIns = inst(class)
  152. if LastIns:IsA"Script" then
  153. s(LastIns)
  154. end
  155. end
  156.  
  157. local function SetProperty(LastIns,p,str,s)
  158. s = Types[typeof(LastIns[p])]
  159. LastIns[p] = s and s(unpack(split(str,comma))) or str
  160. end
  161.  
  162. local UnionData
  163. table_foreach(ct,function(s,p,a,str)
  164. a = p:find":"
  165. p,str = props[tonum(p:sub(1,a-1))],values[tonum(p:sub(a+1))]
  166. if p=="UnionData" then
  167. UnionData = split(str," ")
  168. return
  169. end
  170. if class=="UnionOperation" then
  171. LastIns[p] = str
  172. return
  173. end
  174. SetProperty(LastIns,p,str)
  175. end)
  176.  
  177. if UnionData then
  178. local LI_Data = LastIns
  179. LastIns = DecodeUnion(UnionData)
  180. table_foreach(LI_Data,function(p,str)
  181. SetProperty(LastIns,p,str)
  182. end)
  183. end
  184. table.insert(InstanceList,LastIns)
  185. LastIns[parnt] = CurPar
  186. end
  187. end)
  188. table_remove(ICList,1)
  189. table_foreach(ICList,function(a,b)
  190. b = split(b,">")
  191. InstanceList[tonum(b[1])][props[tonum(b[2])]] = InstanceList[tonum(b[3])]
  192. end)
  193.  
  194. return Model:GetChildren()
  195. end
  196.  
  197. 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'
  198. ..'.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.'
  199. ..'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'
  200. ..'.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'
  201. ..':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;')
  202. for _,Object in pairs(Objects) do
  203. Object.Parent = script and script.Parent==workspace and script or workspace
  204. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement