Advertisement
anphu04

WIP SAVEINSTANCE

May 20th, 2018
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.46 KB | None | 0 0
  1. -- REMADE BY ANPHU04 (5/20/2018) --
  2.  
  3. --SETTINGS--
  4. gameId = 1562190306 --put your starter place id here
  5. --end of settings
  6. LightingProp = {
  7. ['Ambient'] = 'Color3Value',
  8. ['Brightness'] = 'StringValue',
  9. ['ColorShift_Bottom'] = 'Color3Value',
  10. ['ColorShift_Top'] = 'Color3Value',
  11. ['FogColor'] = 'Color3Value',
  12. ['FogEnd'] = 'StringValue',
  13. ['FogStart'] = 'StringValue',
  14. ['GeographicLatitude'] = 'StringValue',
  15. ['GlobalShadows'] = 'BoolValue',
  16. ['GlobalShadows'] = 'BoolValue',
  17. ['OutdoorAmbient'] = 'Color3Value',
  18. ['Outlines'] = 'BoolValue',
  19. ['ShadowColor'] = 'Color3Value',
  20. ['TimeOfDay'] = 'StringValue',
  21. }
  22. StarterProp = {
  23. ['AutoJumpEnabled'] = 'BoolValue',
  24. ['CameraMaxZoomDistance'] = 'StringValue',
  25. ['CameraMinZoomDistance'] = 'StringValue',
  26. ['CameraMode'] = 'StringValue',
  27. ['DevCameraOcclusionMode'] = 'StringValue',
  28. ['DevComputerCameraMovementMode'] = 'StringValue',
  29. ['DevComputerMovementMode'] = 'StringValue',
  30. ['DevTouchCameraMovementMode'] = 'StringValue',
  31. ['DevTouchMovementMode'] = 'StringValue',
  32. ['EnableMouseLockOption'] = 'BoolValue',
  33. ['HealthDisplayDistance'] = 'StringValue',
  34. ['LoadCharacterAppearance'] = 'BoolValue',
  35. ['NameDisplayDistance'] = 'StringValue',
  36. }
  37. WorkspaceProp = {
  38. ['FilteringEnabled'] = 'BoolValue',
  39. ['Gravity'] = 'StringValue',
  40. }
  41. function makePropertyValues(tablepls, servicepls)
  42. local servprops = Instance.new('Folder', mainFolder)
  43. servprops.Name = servicepls..' Properties'
  44. for i, v in pairs(tablepls) do
  45. local meme = Instance.new(v, servprops)
  46. meme.Name = i
  47. if v == 'StringValue' then
  48. meme.Value = tostring(game:GetService(servicepls)[i])
  49. else
  50. meme.Value = game:GetService(servicepls)[i]
  51. end
  52. end
  53. end
  54. function createFolderWithParts(serv)
  55. local fold = Instance.new('Folder', mainFolder)
  56. --fold.Name = serv.ClassName
  57. --[[local function scan(p)
  58. for i, v in pairs(p:GetChildren()) do
  59. if not game:GetService'Players':GetPlayerFromCharacter(v) then
  60. pcall(function()
  61. if v:IsA("Terrain") then
  62. for x, d in pairs(v:GetChildren()) do
  63. d:Clone().Parent = fold
  64. end
  65. return
  66. end
  67. v:Clone().Parent = fold
  68. end)
  69. end
  70. scan(v)
  71. end
  72. end
  73. scan(serv)]]
  74. for i,v in pairs(serv:GetChildren()) do
  75. if (v:IsA("BasePart") or v:IsA("Model")) and (not v:IsA("Terrain")) then
  76. if not game.Players:FindFirstChild(v.Name) then
  77. v:Clone().Parent = fold
  78. end
  79. end
  80. end
  81. end
  82. function screwYouArchivable(same)
  83. pcall(function()
  84. same.Archivable = true
  85. end)
  86. for i, v in pairs(same:GetChildren()) do
  87. screwYouArchivable(v)
  88. end
  89. end
  90. function checkScript(inst)
  91. if inst:IsA'LocalScript' or inst:IsA'ModuleScript' then
  92. if ELYSIAN_INITIATED then
  93. local valuecount = 1
  94. local count = 1
  95. local sadmeme = tostring(decompile(inst))
  96. repeat
  97. local kek = Instance.new('StringValue', inst)
  98. kek.Name = 'Source'..valuecount
  99. kek.Value = string.sub(sadmeme, count, count + 99999)
  100. count = count + 100000
  101. valuecount = valuecount + 1
  102. until string.sub(sadmeme, count, count + 99999) == ''
  103. end
  104. end
  105. for i, v in pairs(inst:GetChildren()) do
  106. checkScript(v)
  107. end
  108. end
  109. mainFolder = Instance.new'Folder'
  110. mainFolder.Name = 'Place'
  111. --screwYouArchivable(game)
  112. screwYouArchivable(game.Workspace)
  113. screwYouArchivable(game.Lighting)
  114. screwYouArchivable(game.ReplicatedStorage)
  115. --[[for i, v in pairs(game:GetChildren()) do
  116. createFolderWithParts(v)
  117. end]]
  118. createFolderWithParts(workspace)
  119. createFolderWithParts(game.Lighting)
  120. createFolderWithParts(game.ReplicatedStorage)
  121. if getnilinstances then
  122. local nilf = Instance.new('Folder', mainFolder)
  123. nilf.Name = 'NIL INSTANCES'
  124. for i, v in pairs(getnilinstances()) do
  125. screwYouArchivable(v)
  126. pcall(function()
  127. if v == mainFolder then
  128. return
  129. end
  130. v:Clone().Parent = nilf
  131. end)
  132. end
  133. end
  134. checkScript(mainFolder)
  135. terraind = Instance.new('Folder', mainFolder)
  136. terraind.Name = 'TerrainData'
  137. workspace:FindFirstChildOfClass'Terrain':CopyRegion(workspace:FindFirstChildOfClass'Terrain'.MaxExtents).Parent = terraind
  138. makePropertyValues(LightingProp, 'Lighting')
  139. makePropertyValues(StarterProp, 'StarterPlayer')
  140. makePropertyValues(WorkspaceProp, 'Workspace')
  141.  
  142.  
  143.  
  144. -- DEBUGGING --
  145. for i,a in pairs(mainFolder:GetChildren()) do
  146. for i,b in pairs(a:GetChildren()) do
  147. print(b.Name .." : ".. tostring(b.ClassName))
  148. end
  149. end
  150.  
  151.  
  152.  
  153.  
  154.  
  155. game:GetService'TeleportService':SetTeleportSetting('SaveInstanceData', mainFolder)
  156. game:GetService'TeleportService':Teleport(gameId)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement