Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Return = ""
- local DecompileScripts = false
- function CreateInstance(Object)
- local Name = string.gsub(Object.Name, " ", "_")
- Return = Return.."local "..Name.." = Instance.new('"..tostring(Object.ClassName).."')\n"..Name..".Size = Vector3.new("..tostring(Object.Size.X)..", "..tostring(Object.Size.Y)..", "..tostring(Object.Size.Z)..")\n"..Name..".Position = CFrame.new("..tostring(Object.Position.X)..", "..tostring(Object.Position.Y)..", "..tostring(Object.Position.Z)..")\n"..Name..".BrickColor = BrickColor.new('"..tostring(Object.BrickColor).."')\n"..Name..".TopSurface = "..tostring(Object.TopSurface).."\n"..Name..".BottomSurface = "..tostring(Object.BottomSurface).."\n"..Name..".BackSurface = "..tostring(Object.BackSurface).."\n"..Name..".FrontSurface = "..tostring(Object.FrontSurface).."\n"..Name..".LeftSurface = "..tostring(Object.LeftSurface).."\n"..Name..".RightSurface = "..tostring(Object.RightSurface).."\n"..Name..".CanCollide = "..tostring(Object.CanCollide).."\n"..Name..".Anchored = "..tostring(Object.Anchored).."\n"..Name..".Name = '"..Name.."'\n"..Name..".Parent = game.Workspace\n\n"
- end
- function CreateScript(Object)
- local Name = string.gsub(Object.Name, " ", "_")
- Return = Return.."local "..Name.." = Instance.new('"..tostring(Object.ClassName).."')\n"..Name..".Name = '"..Name.."'\n"..Name..".Source = [["..tostring(decompile(Object)).."]]\n"..Name..".Parent = game.Workspace\n\n"
- end
- function Recursive(Object)
- wait()
- for _,Part in pairs(Object:GetChildren()) do
- if Part:IsA("BasePart") and Part.Name ~= "Terrain" then
- CreateInstance(Part)
- elseif Part:IsA("LocalScript") and DecompileScripts or Part:IsA("ModuleScript") and DecompileScripts then
- CreateScript(Part)
- end
- Recursive(Part)
- end
- end
- local Cloning = Recursive(game.Workspace)
- repeat wait() until not Cloning
- local Cloning2 = Recursive(game.Players.LocalPlayer)
- repeat wait() until not Cloning2
- warn("Done Cloning")
- copystr(Return)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement