Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = game.Players.LocalPlayer
- local czekanie = 0
- local textLenght = 500000
- local MainString = ""
- local brakuje
- local HttpService = game:GetService("HttpService")
- local screenGui = Instance.new("ScreenGui",plr.PlayerGui)
- screenGui.IgnoreGuiInset = true
- screenGui.DisplayOrder = math.huge
- local scrolingFrame = Instance.new("ScrollingFrame",screenGui)
- scrolingFrame.Size = UDim2.new(0.184, 0,0.411, 0)
- scrolingFrame.AutomaticCanvasSize = Enum.AutomaticSize.Y
- scrolingFrame.Position = UDim2.new(0, 0,0.129, 0)
- local list = Instance.new("UIListLayout",scrolingFrame)
- local cloneButton = Instance.new("TextButton",screenGui)
- cloneButton.Size = UDim2.new(0.184, 0,0.08, 0)
- cloneButton.Position = UDim2.new(0, 0,0.539, 0)
- cloneButton.BackgroundColor3 = Color3.new(0.333333, 1, 0)
- cloneButton.TextScaled = true
- cloneButton.Text = "Clone Game"
- if game.ReplicatedStorage:FindFirstChild("MainFolder") then
- game.ReplicatedStorage.MainFolder:Destroy()
- end
- local MainFolder
- local activated = false
- local objects
- cloneButton.MouseButton1Up:Connect(function()
- if activated then return else activated = true end
- brakuje = {}
- MainFolder = Instance.new("Folder",game.ReplicatedStorage)
- MainFolder.Name = "MainFolder"
- CreateFoldersFUNCTION()
- objects = MainFolder:GetDescendants()
- wait(1)
- ChangeNamesFUNCTION()
- wait(1)
- CreatingLocFUNCTION()
- wait(1)
- CloneFUNCTION()
- MainFolder:Destroy()
- wait(1)
- createButtonsFUNCTION()
- wait(1)
- activated = false
- cloneButton.Text = "Clone Game"
- end)
- local function createFolder(obj,name)
- local newFolder = Instance.new("Folder",MainFolder)
- newFolder.Name = name or obj.Name
- for i,child in pairs(obj:GetChildren()) do
- if child.Archivable == false then
- child.Archivable = true
- local ChangeArchivable = Instance.new("RayValue",child)
- ChangeArchivable.Name = "ChangeArchivable"
- end
- local success, result = pcall(function()
- local klon = child:Clone()
- klon.Parent = newFolder
- end)
- if not success then
- warn("twożenie folderu: "..result)
- end
- end
- end
- function CreateFoldersFUNCTION()
- cloneButton.Text = "Creating folders"-------------------------------------------
- createFolder(game.Lighting)
- createFolder(plr.PlayerGui,"CurrentGui")
- createFolder(game.StarterGui)
- createFolder(game.ReplicatedStorage)
- createFolder(workspace)
- wait(0.5)
- cloneButton.Text = "Succes1"--------------------------------------------------
- end
- local function filterText(text)
- text = string.gsub(text,"?","?1")
- text = string.gsub(text,"ChangeArchivable","?2")
- text = string.gsub(text,"#","?3")
- text = string.gsub(text,"*","?4")
- text = string.gsub(text,"MainFolder","?5")
- text = string.gsub(text,"_","?6")
- text = string.gsub(text,":","?7")
- text = string.gsub(text," ","?8")
- return text
- end
- function ChangeNamesFUNCTION()
- cloneButton.Text = "Changing names"-------------------------------------------
- local saveAmount = #objects
- for i,child in pairs(objects) do
- child.Name = filterText(child.Name).."#"..i
- cloneButton.Text = "Changing names "..i.."/"..saveAmount
- if czekanie >= 100 then task.wait() czekanie = 0 else czekanie+= 1 end
- end
- cloneButton.Text = "Succes2"--------------------------------------------------
- end
- function CreatingLocFUNCTION()
- local iloscOBJ = #objects
- local function returnLoc(obj)
- local toReturn = ""
- local current = obj.Parent
- while current.Name ~= "MainFolder" do
- toReturn = current.Name.."*"..toReturn
- current = current.Parent
- end
- return toReturn
- end
- local lokalizacje = {}
- for i,child in pairs(objects) do
- local success, result = pcall(function()
- local loc = Instance.new("StringValue")
- loc.Name = "Loc"
- loc.Parent = child
- loc.Value = returnLoc(child)
- table.insert(lokalizacje,loc)
- end)
- if not success then
- warn(child,result)
- end
- if czekanie >= 50 then
- czekanie = 0
- task.wait()
- cloneButton.Text = "Addod Localizations ("..i.."/"..iloscOBJ..")"
- else czekanie += 1 end
- end
- cloneButton.Text = "Succes3"--------------------------------------------------
- end
- local function zaokrongl(num)
- return num
- end
- local function CodeObject(object)
- if object:IsA("Pose") then
- return ""
- end
- local codeddStr = ""
- local success, result = pcall(function()
- codeddStr = "c:"..object.ClassName
- codeddStr = codeddStr .. "_n:"..tostring(object.Name)
- codeddStr = codeddStr .. "_l:"..tostring(object.Loc.Value)
- if object:IsA("BasePart") then--------------------------------------------------------------------------
- codeddStr = codeddStr .. "_Bp:"..tostring(zaokrongl(object.Position.X).."="..zaokrongl(object.Position.Y).."="..zaokrongl(object.Position.Z))
- codeddStr = codeddStr .. "_Bs:"..tostring(zaokrongl(object.Size.X).."="..zaokrongl(object.Size.Y).."="..zaokrongl(object.Size.Z))
- codeddStr = codeddStr .. "_Bc:"..tostring(object.Color.R.."="..object.Color.G.."="..object.Color.B)
- codeddStr = codeddStr .. "_Br:"..tostring(zaokrongl(object.Orientation.X).."="..zaokrongl(object.Orientation.Y).."="..zaokrongl(object.Orientation.Z))
- if object.Transparency ~= 0 then
- codeddStr = codeddStr .. "_Bt:"..tostring(object.Transparency)
- end
- if object.CastShadow ~= true then
- codeddStr = codeddStr .. "_Bcs:"
- end
- if object.CanCollide ~= true then
- codeddStr = codeddStr .. "_Bcc:"
- end
- if object.CanTouch ~= true then
- codeddStr = codeddStr .. "_Bct:"
- end
- if object.CanQuery ~= true then
- codeddStr = codeddStr .. "_Bcq:"
- end
- if object.Material ~= Enum.Material.Plastic then
- codeddStr = codeddStr .. "_Bm:" ..tostring(object.Material.Value)
- end
- if object.Anchored == false then
- codeddStr = codeddStr .. "_Ba:"
- end
- if not object:IsA("WedgePart") and not object:IsA("MeshPart") and not object:IsA("CornerWedgePart") and object.Shape.Value ~= 1 then
- codeddStr = codeddStr .. "_Bs:" ..tostring(object.Shape.Value)
- end
- if object.BackSurface.Value ~= 0 then------------------surfaces
- codeddStr = codeddStr .. "_Bbs:" ..tostring(object.BackSurface.Value)
- end
- if object.BottomSurface.Value ~= 0 then
- codeddStr = codeddStr .. "_Bbts:" ..tostring(object.BottomSurface.Value)
- end
- if object.FrontSurface.Value ~= 0 then
- codeddStr = codeddStr .. "_Bfs:" ..tostring(object.FrontSurface.Value)
- end
- if object.LeftSurface.Value ~= 0 then
- codeddStr = codeddStr .. "_Bls:" ..tostring(object.LeftSurface.Value)
- end
- if object.RightSurface.Value ~= 0 then
- codeddStr = codeddStr .. "_Brs:" ..tostring(object.RightSurface.Value)
- end
- if object.TopSurface.Value ~= 0 then
- codeddStr = codeddStr .. "_Bts:" ..tostring(object.TopSurface.Value)
- end
- elseif object:IsA("Decal") then-------------------------------------------------------------------
- if object.Texture ~= nil or object.Texture ~= "" then
- codeddStr = codeddStr .. "_Dt:" ..tostring(string.gsub(object.Texture,":","?1"))
- end
- if object.Face ~= 5 then
- codeddStr = codeddStr .. "_Df:" ..tostring(object.Face.Value)
- end
- if object.Transparency ~= 0 then
- codeddStr = codeddStr .. "_Dtr:" ..tostring(object.Face.Value)
- end
- if object.ZIndex ~= 1 then
- codeddStr = codeddStr .. "_Dz:" ..tostring(object.Face.Value)
- end
- elseif object:IsA("Attachment") then-------------------------------------------------------------------
- codeddStr = codeddStr .. "_Ap:"..tostring(zaokrongl(object.Position.X).."="..zaokrongl(object.Position.Y).."="..zaokrongl(object.Position.Z))
- codeddStr = codeddStr .. "_Ar:"..tostring(zaokrongl(object.Orientation.X).."="..zaokrongl(object.Orientation.Y).."="..zaokrongl(object.Orientation.Z))
- codeddStr = codeddStr .. "_Ax:"..tostring(zaokrongl(object.Axis.X).."="..zaokrongl(object.Axis.Y).."="..zaokrongl(object.Axis.Z))
- codeddStr = codeddStr .. "_Asx:"..tostring(zaokrongl(object.SecondaryAxis.X).."="..zaokrongl(object.SecondaryAxis.Y).."="..zaokrongl(object.SecondaryAxis.Z))
- codeddStr = codeddStr .. "_Awp:"..tostring(zaokrongl(object.WorldPosition.X).."="..zaokrongl(object.WorldPosition.Y).."="..zaokrongl(object.WorldPosition.Z))
- codeddStr = codeddStr .. "_Awr:"..tostring(zaokrongl(object.WorldOrientation.X).."="..zaokrongl(object.WorldOrientation.Y).."="..zaokrongl(object.WorldOrientation.Z))
- codeddStr = codeddStr .. "_Awx:"..tostring(zaokrongl(object.WorldAxis.X).."="..zaokrongl(object.WorldAxis.Y).."="..zaokrongl(object.WorldAxis.Z))
- codeddStr = codeddStr .. "_Awsx:"..tostring(zaokrongl(object.WorldSecondaryAxis.X).."="..zaokrongl(object.WorldSecondaryAxis.Y).."="..zaokrongl(object.WorldSecondaryAxis.Z))
- if object.Visible ~= false then
- codeddStr = codeddStr .. "_Av:" ..tostring(object.Visible)
- end
- elseif object:IsA("ValueBase") then-------------------------------------------------------------------
- if object:IsA("BoolValue") and object.Value ~= false then
- codeddStr = codeddStr .. "_Vb:"
- elseif object:IsA("BrickColorValue") then
- codeddStr = codeddStr .. "_Vbc:"..object.Value.Number
- elseif object:IsA("CFrameValue") then
- codeddStr = codeddStr .. "_Vcf:"..tostring(zaokrongl(object.Value.Position.X).."="..zaokrongl(object.Value.Position.Y).."="..zaokrongl(object.Value.Position.Z).."="..zaokrongl(object.Value.Rotation.X).."="..zaokrongl(object.Value.Rotation.Y).."="..zaokrongl(object.Value.Rotation.Z))
- elseif object:IsA("Color3Value") then
- codeddStr = codeddStr .. "_Vc:"..tostring(object.Value.R.."="..object.Value.G.."="..object.Value.B)
- elseif object:IsA("IntValue") or object:IsA("NumberValue") then
- codeddStr = codeddStr .. "_V:"..object.Value
- elseif object:IsA("Vector3Value") then
- codeddStr = codeddStr .. "_V3:"..tostring(zaokrongl(object.Value.X).."="..zaokrongl(object.Value.Y).."="..zaokrongl(object.Value.Z))
- elseif object:IsA("StringValue") then
- codeddStr = codeddStr .. "_V:"..filterText(object.Value)
- end
- else
- if brakuje[object.ClassName] then
- brakuje[object.ClassName] += 1
- else
- brakuje[object.ClassName] = 1
- end
- end
- codeddStr = codeddStr.." "
- end)
- if not success then
- warn(result)
- end
- return codeddStr
- end
- local SplitedTexts
- function CloneFUNCTION()
- SplitedTexts = {}
- local MainString = ""
- local iloscOBJ = #objects
- for i,child in pairs(objects) do
- MainString = MainString..CodeObject(child)
- if #MainString >= textLenght then
- table.insert(SplitedTexts,MainString)
- MainString = ""
- end
- if czekanie >= 50 then
- czekanie = 0
- task.wait()
- cloneButton.Text = "Copying game ("..i.."/"..iloscOBJ..")"
- else czekanie += 1 end
- end
- table.insert(SplitedTexts,MainString)
- cloneButton.Text = "Succes4"--------------------------------------------------
- end
- local function sortTableByValueDesc(inputTable)
- -- Tworzymy listę z par (klucz, wartość)
- local sortedList = {}
- for key, value in pairs(inputTable) do
- table.insert(sortedList, {key = key, value = value})
- end
- -- Sortujemy listę według wartości w malejącym porządku
- table.sort(sortedList, function(a, b)
- return a.value > b.value
- end)
- -- Zwracamy posortowaną listę
- return sortedList
- end
- function createButtonsFUNCTION()
- for i,child in pairs(scrolingFrame:GetChildren()) do
- if not child:IsA("UIListLayout") then
- child:Destroy()
- end
- end
- for i,child in pairs(SplitedTexts) do
- local button = Instance.new("TextButton",scrolingFrame)
- button.Text = #SplitedTexts[i]
- button.Size = UDim2.new(0.8, 0,0.25, 0)
- button.TextScaled = true
- button.MouseButton1Up:Connect(function()
- if game["Run Service"]:IsStudio() then
- print(SplitedTexts[i])
- else
- setclipboard(SplitedTexts[i])
- button.BackgroundColor3 = Color3.new(0.333333, 1, 0)
- wait(1)
- button.BackgroundColor3 = Color3.new(1, 1, 1)
- end
- end)
- wait(.5)
- end
- warn(sortTableByValueDesc(brakuje))
- cloneButton.Text = "Succes5"
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement