Advertisement
Guest User

Untitled

a guest
Nov 16th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.00 KB | None | 0 0
  1. local apiDump = game:HttpGet("https://pastebin.com/raw/kuniihjw")
  2. local function getPropertyTable(className)
  3. local propertyTable = {}
  4. local function getProperties(className)
  5. for w in apiDump:gmatch("Property [%w+%p]+ "..className.."%.%w+[ %p%w]*") do
  6. local s,f = w:find("%.%w+")
  7. if not w:match("%[deprecated%]") and not w:match("%[readonly%]") then
  8. local propertyName = w:sub(s+1,f)
  9. propertyTable[propertyName] = true
  10. end
  11. end
  12. local classInfo = apiDump:match("Class "..className.." [ %w%p]*")
  13. local nextClass = classInfo:match(": [%w%p]+")
  14. if nextClass then
  15. getProperties(nextClass:sub(3))
  16. end
  17. end
  18. getProperties(className)
  19. return propertyTable
  20. end
  21.  
  22. local function DataTypeToTable(data)
  23. if typeof(data) == "BrickColor" then
  24. return {type = typeof(data), name = data.Name}
  25. elseif typeof(data) == "Color3" then
  26. return {type = typeof(data), r = data.r, g = data.g, b = data.b}
  27. elseif typeof(data) == "Vector3" then
  28. return {type = typeof(data), x = data.X, y = data.Y, z = data.Z}
  29. elseif typeof(data) == "Vector2" then
  30. return {type = typeof(data), x = data.X, y = data.Y}
  31. elseif typeof(data) == "PhysicalProperties" then
  32. return {type = typeof(data), d = data.Density, f = data.Friction, e = data.Elasticity, fw = data.FrictionWeight, ew = data.ElasticityWeight}
  33. end
  34. end
  35.  
  36. local instances = {}
  37. local function Copy(instance)
  38. local propertyTable = getPropertyTable(instance.className)
  39. local instanceProperties = {}
  40. instanceProperties.ClassName = instance.ClassName
  41. for i,v in next, propertyTable do
  42. if typeof(instance[i])== "EnumItem" then
  43. instanceProperties[i] = {}
  44. instanceProperties[i].Value = instance[i].Name
  45. elseif typeof(instance[i]) == "string" or typeof(instance[i]) == "number" or typeof(instance[i]) == "boolean" then
  46. instanceProperties[i] = {}
  47. instanceProperties[i].Value = instance[i]
  48. else
  49. local t = DataTypeToTable(instance[i])
  50. if t then
  51. instanceProperties[i] = {}
  52. instanceProperties[i].Value = t
  53. end
  54. end
  55. end
  56. table.insert(instances,instanceProperties)
  57. end
  58.  
  59. for i,v in next, workspace.z1:GetDescendants() do
  60. if v:IsA("BasePart") then
  61. Copy(v)
  62. game:GetService("RunService").Heartbeat:Wait()
  63. end
  64. end
  65. writefile("studio.lua","local a=game:GetService('HttpService'):JSONDecode('"..game:GetService('HttpService'):JSONEncode(instances).."')local c=Instance.new('Folder',workspace)local function b(a)if a.type=='BrickColor'then return BrickColor.new(a.Value.Name)elseif a.type=='Color3'then return Color3.new(a.Value.r,a.Value.g,a.Value.b)elseif a.type=='Vector3'then return Vector3.new(a.Value.X,a.Value.Y,a.value.Z)elseif a.type=='Vector2'then return Vector2.new(a.value.X,a.value.Y)elseif a.type=='PhysicalProperties'then return PhysicalProperties.new(a.value.d,a.value.f,a.value.e,a.value.fw,a.value.ew)end end for a,a in next,a do local d=Instance.new(a.ClassName)for a,c in next,a do if type(c)=='table'then if type(c.Value)=='table'then d[a]=b(c)else d[a]=c.Value end end end d.Parent=c end")
  66. warn("Done")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement