Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local apiDump = game:HttpGet("https://pastebin.com/raw/kuniihjw")
- local function getPropertyTable(className)
- local propertyTable = {}
- local function getProperties(className)
- for w in apiDump:gmatch("Property [%w+%p]+ "..className.."%.%w+[ %p%w]*") do
- local s,f = w:find("%.%w+")
- if not w:match("%[deprecated%]") and not w:match("%[readonly%]") then
- local propertyName = w:sub(s+1,f)
- propertyTable[propertyName] = true
- end
- end
- local classInfo = apiDump:match("Class "..className.." [ %w%p]*")
- local nextClass = classInfo:match(": [%w%p]+")
- if nextClass then
- getProperties(nextClass:sub(3))
- end
- end
- getProperties(className)
- return propertyTable
- end
- local function DataTypeToTable(data)
- if typeof(data) == "BrickColor" then
- return {type = typeof(data), name = data.Name}
- elseif typeof(data) == "Color3" then
- return {type = typeof(data), r = data.r, g = data.g, b = data.b}
- elseif typeof(data) == "Vector3" then
- return {type = typeof(data), x = data.X, y = data.Y, z = data.Z}
- elseif typeof(data) == "Vector2" then
- return {type = typeof(data), x = data.X, y = data.Y}
- elseif typeof(data) == "PhysicalProperties" then
- return {type = typeof(data), d = data.Density, f = data.Friction, e = data.Elasticity, fw = data.FrictionWeight, ew = data.ElasticityWeight}
- end
- end
- local instances = {}
- local function Copy(instance)
- local propertyTable = getPropertyTable(instance.className)
- local instanceProperties = {}
- instanceProperties.ClassName = instance.ClassName
- for i,v in next, propertyTable do
- if typeof(instance[i])== "EnumItem" then
- instanceProperties[i] = {}
- instanceProperties[i].Value = instance[i].Name
- elseif typeof(instance[i]) == "string" or typeof(instance[i]) == "number" or typeof(instance[i]) == "boolean" then
- instanceProperties[i] = {}
- instanceProperties[i].Value = instance[i]
- else
- local t = DataTypeToTable(instance[i])
- if t then
- instanceProperties[i] = {}
- instanceProperties[i].Value = t
- end
- end
- end
- table.insert(instances,instanceProperties)
- end
- for i,v in next, workspace.z1:GetDescendants() do
- if v:IsA("BasePart") then
- Copy(v)
- game:GetService("RunService").Heartbeat:Wait()
- end
- end
- 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")
- warn("Done")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement