Advertisement
WDGASTER132

Untitled

Aug 16th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. local copyWhat = "Workspace"
  2.  
  3. local skipObjVals = true -- Skip "Object" properties, speeds up a lot. Set false if you want to copy things like welds.
  4.  
  5.  
  6.  
  7. local copyGroup = Instance.new("Model",game.ReplicatedStorage)
  8.  
  9. function archivable(root)
  10. for i,v in pairs(root:GetChildren()) do
  11. if not game.Players:GetPlayerFromCharacter(v) then
  12. v.Archivable = true
  13. archivable(v)
  14. end
  15. end
  16. end
  17.  
  18. function decompileS(root)
  19. for i,v in pairs(root:GetChildren()) do
  20. if v:IsA("LocalScript") then
  21. local isDisabled = v.Disabled
  22. v.Disabled = true
  23. v.Source = decompile(v)
  24. v.Disabled = isDisabled
  25. elseif v:IsA("ModuleScript") then
  26. v.Source = decompile(v)
  27. end
  28. decompileS(v)
  29. end
  30. end
  31.  
  32. archivable(game[copyWhat])
  33.  
  34. for i,v in pairs(game[copyWhat]:GetChildren()) do
  35. pcall(function()
  36. v:Clone().Parent = copyGroup
  37. end)
  38. end
  39.  
  40. --decompileS(copyGroup)
  41.  
  42. _G.SaveInstance(copyGroup,tostring(game.PlaceId)..copyWhat,skipObjVals)
  43. print("Saved!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement