anphu04

ROBLOX Steal Places Script (STEP 2)

Nov 2nd, 2019
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.69 KB | None | 0 0
  1. -- 2/11/2019: A F F E C T I O N --
  2. -- the (\n) when printed out will print (2 times ' ')
  3.  
  4. local inp = [[]] -- paste everything in here, do not change anything from it!
  5.  
  6. local txt = ""
  7. local mod = Instance.new('Model')
  8. local i = 1
  9. local dem = 0
  10.  
  11. function c(i)
  12. return inp:sub(i,i)
  13. end
  14. function s(i,j)
  15. return inp:sub(i,j)
  16. end
  17.  
  18.  
  19. print('the start of an era')
  20. print('the input is ' ..tostring(#inp).. ' characters long')
  21.  
  22. while i <= #inp do
  23. local function cc(str, i)
  24. return str:sub(i,i)
  25. end
  26. local function ss(str, i,j)
  27. return str:sub(i,j)
  28. end
  29.  
  30. if c(i) == '{' then
  31. dem = dem + 1
  32.  
  33. i = i + 2
  34. local classname = s( i, inp:find('\n', i)-1 ) -- use the \n as the basis to everything
  35. local obj = Instance.new( classname )
  36. i = i + #classname + 1 -- move the i to the next line
  37.  
  38. local name = s( i, inp:find('\n', i)-1 )
  39. obj.Name = name
  40. i = i + #name + 1
  41.  
  42. local colorstr = s( i, inp:find('\n', i)-1 )
  43. local colors = {}
  44. local ii = 1
  45. while ii <= #colorstr do -- colorstr is a small string that contains the color3
  46. if string.match(cc(colorstr,ii), '%d') ~= nil then -- color cannot be negative
  47. local l = 0
  48. for jj = ii, #colorstr do
  49. if string.match(cc(colorstr,jj), '%d') ~= nil or cc(colorstr,jj) == '.' then
  50. l = l + 1
  51. else
  52. break
  53. end
  54. end
  55. table.insert(colors, ss(colorstr,ii, ii+l-1))
  56. ii = ii + l + 1
  57. else
  58. ii = ii + 1
  59. end
  60. end
  61. obj.Color = Color3.new(unpack(colors))
  62. i = i + #colorstr + 1
  63.  
  64. local material = s( i, inp:find('\n', i)-1 )
  65. obj.Material = Enum.Material[material]
  66. i = i + #material + 1
  67. local reflectance = s( i, inp:find('\n', i)-1 )
  68. obj.Reflectance = tonumber(reflectance)
  69. i = i + #reflectance + 1
  70. local transparency = s( i, inp:find('\n', i)-1 )
  71. obj.Transparency = tonumber(transparency)
  72. i = i + #transparency + 1
  73.  
  74.  
  75.  
  76. local cfstr = s( i, inp:find('\n', i)-1 )
  77. local cfs = {}
  78. local ii = 1
  79. while ii <= #cfstr do -- cfstr is a small string that contains the vector3
  80. if string.match(cc(cfstr,ii), '%d') ~= nil or cc(cfstr,ii) == '-' then -- cframe could very be a negative number
  81. local l = 0
  82. for jj = ii, #cfstr do
  83. if string.match(cc(cfstr,jj), '%d') ~= nil or (cc(cfstr,jj) == '.' or cc(cfstr,jj) == '-' or cc(cfstr,jj) == 'e') then -- cframe numbers can sometimes be very small like 10^-n
  84. l = l + 1
  85. else
  86. break
  87. end
  88. end
  89. table.insert(cfs, ss(cfstr,ii, ii+l-1))
  90. ii = ii + l + 1
  91. else
  92. ii = ii + 1
  93. end
  94. end
  95. obj.CFrame = CFrame.new(unpack(cfs))
  96. i = i + #cfstr + 1
  97.  
  98.  
  99.  
  100. if s(i, i+3) == "true" then
  101. obj.Anchored = true
  102. i = i + 5 -- idk why it has to be +1 but lets just follow it
  103. elseif s(i, i+4) == "false" then
  104. obj.Anchored = false
  105. i = i + 6
  106. end
  107. if s(i, i+3) == "true" then
  108. obj.CanCollide = true
  109. i = i + 5
  110. elseif s(i, i+4) == "false" then
  111. obj.CanCollide = false
  112. i = i + 6
  113. end
  114.  
  115.  
  116.  
  117. if classname == "Part" then -- only normal parts have the shape property
  118. local shape = s( i, inp:find('\n', i)-1 )
  119. obj.Shape = Enum.PartType[shape]
  120. i = i + #shape + 1
  121. end
  122.  
  123. local sizestr = s( i, inp:find('\n', i)-1 )
  124. local sizes = {}
  125. local ii = 1
  126. while ii <= #sizestr do -- sizestr is a small string that contains the vector3
  127. if string.match(cc(sizestr,ii), '%d') ~= nil then -- size cannot be negative
  128. local l = 0
  129. for jj = ii, #sizestr do
  130. if string.match(cc(sizestr,jj), '%d') ~= nil or cc(sizestr,jj) == '.' then
  131. l = l + 1
  132. else
  133. break
  134. end
  135. end
  136. table.insert(sizes, ss(sizestr,ii, ii+l-1))
  137. ii = ii + l + 1
  138. else
  139. ii = ii + 1
  140. end
  141. end
  142. obj.Size = Vector3.new(unpack(sizes))
  143. i = i + #sizestr + 1
  144.  
  145.  
  146.  
  147.  
  148.  
  149. while i <= #inp do
  150. if c(i) == '[' then
  151. i = i + 2
  152. local classname = s( i, inp:find('\n', i)-1 )
  153. local mesh = Instance.new( classname )
  154. i = i + #classname + 1
  155.  
  156. local name = s( i, inp:find('\n', i)-1 )
  157. mesh.Name = name
  158. i = i + #name + 1
  159.  
  160. if classname == 'SpecialMesh' then
  161. local meshtype = s( i, inp:find('\n', i)-1 )
  162. mesh.MeshType = Enum.MeshType[meshtype]
  163. i = i + #meshtype + 1
  164. if meshtype == 'FileMesh' then
  165. local meshid = s( i, inp:find('\n', i)-1 )
  166. mesh.MeshId = meshid
  167. i = i + #meshid + 1
  168. local texid = s( i, inp:find('\n', i)-1 )
  169. mesh.TextureId = texid
  170. i = i + #texid + 1
  171. end
  172. end
  173.  
  174.  
  175.  
  176. local scalestr = s( i, inp:find('\n', i)-1 )
  177. local scales = {}
  178. local ii = 1
  179. while ii <= #scalestr do -- scalestr is a small string that contains the vector3
  180. if string.match(cc(scalestr,ii), '%d') ~= nil or cc(scalestr,ii) == '-' then -- scale can sometimes be negative, if it is inside out
  181. local l = 0
  182. for jj = ii, #scalestr do
  183. if string.match(cc(scalestr,jj), '%d') ~= nil or (cc(scalestr,jj) == '.' or cc(scalestr,ii) == '-') then
  184. l = l + 1
  185. else
  186. break
  187. end
  188. end
  189. table.insert(scales, ss(scalestr,ii, ii+l-1))
  190. ii = ii + l + 1
  191. else
  192. ii = ii + 1
  193. end
  194. end
  195. mesh.Scale = Vector3.new(unpack(scales))
  196. i = i + #scalestr + 1
  197.  
  198. mesh.Parent = obj
  199. break
  200. elseif c(i) == '}' then -- meaning that there is no sub-instances inside that obj
  201. break
  202. end
  203. i = i + 1 -- keep finding until the end of the obj infos
  204. end
  205.  
  206.  
  207.  
  208.  
  209. obj.TopSurface = 'Smooth'
  210. obj.BottomSurface = 'Smooth'
  211. obj.Parent = mod
  212. end
  213.  
  214.  
  215. i = i + 1
  216. end
  217.  
  218. mod.Parent = workspace
  219. print('loaded ' ..tostring(dem).. ' parts')
  220. game:GetService('ChangeHistoryService'):SetWaypoint('WE BOUT TO MAKE HISTORY BOIS')
Add Comment
Please, Sign In to add comment