1. local collectionService = game:GetService("CollectionService")
  2. local player = game.Players.LocalPlayer
  3. _G.refreshing = true
  4. local cloneGui = {}
  5. function cloneGui.buildRoot()
  6. local paintFrame = player.PlayerGui.MainGui.PaintFrame
  7. local cloneFrame = paintFrame:Clone()
  8. -- Initialize root frame.
  9. cloneFrame.Name = 'CloneFrame'
  10. cloneFrame.Parent = paintFrame
  11. cloneFrame.ToolsFrame:Destroy()
  12. cloneFrame.ColorFrame:Destroy()
  13. cloneFrame.NextButton:Destroy()
  14. cloneFrame.GridHolder.Grid:Destroy()
  15. cloneFrame.UIAspectRatioConstraint:Destroy()
  16. cloneFrame.Confirmation:Destroy()
  17. cloneFrame.AnchorPoint = Vector2.new(0, 0.5)
  18. cloneFrame.Position = UDim2.new(1, 10, 0.5, 0)
  19. cloneFrame.Size = UDim2.new(0.5, 0, 1, 0)
  20. cloneFrame.Visible = true
  21. paintFrame.Position = UDim2.new(0.5, -((cloneFrame.AbsoluteSize.X / 2) + 5), 0.5, 0)
  22. cloneGui.root = cloneFrame
  23. end
  24. function cloneGui.buildButtons()
  25. local nextButton = player.PlayerGui.MainGui.PaintFrame.NextButton
  26. local copyButton = nextButton:Clone()
  27. local cloneButton = nextButton:Clone()
  28. local buttonSize = UDim2.new(0.4, 0, 0.09, 0)
  29. -- Initialize copy button.
  30. copyButton.Parent = cloneGui.root
  31. copyButton.Size = buttonSize
  32. copyButton.Position = UDim2.new(0.28, 0, 0.895)
  33. copyButton.Label.Text = 'COPY'
  34. copyButton.Name = 'CopyButton'
  35. -- Initialize clone button.
  36. cloneButton.Parent = cloneGui.root
  37. cloneButton.Size = buttonSize
  38. cloneButton.Position = UDim2.new(0.72, 0, 0.895)
  39. cloneButton.Label.Text = 'CLONE'
  40. cloneButton.Name = 'CloneButton'
  41. -- Animation functions.
  42. for i, button in pairs({cloneButton, copyButton}) do
  43. button.MouseEnter:Connect(function()
  44. button:TweenSize(UDim2.new(buttonSize.X.Scale + 0.015, 0, buttonSize.Y.Scale + 0.015, 0), 'Out', 'Quad', 0.2, true)
  45. end)
  46. button.MouseLeave:Connect(function()
  47. button:TweenSize(buttonSize, 'Out', 'Quad', 0.2, true)
  48. end)
  49. end
  50. -- Button actions.
  51. copyButton.MouseButton1Click:Connect(copyGrid)
  52. cloneButton.MouseButton1Click:Connect(cloneGrid)
  53. end
  54. function cloneGui.buildScrollingFrame()
  55. local scrollingFrame = Instance.new('ScrollingFrame')
  56. local uiListLayout = Instance.new('UIListLayout')
  57. local uiPadding = Instance.new('UIPadding')
  58. -- Initialize scrolling frame.
  59. scrollingFrame.Parent = cloneGui.root
  60. scrollingFrame.AnchorPoint = Vector2.new(0.5, 0)
  61. scrollingFrame.Position = UDim2.new(0.5, 0, 0.05, 0)
  62. scrollingFrame.Size = UDim2.new(0.8, 0, 0.75, 0)
  63. scrollingFrame.BackgroundTransparency = 1
  64. scrollingFrame.BorderSizePixel = 0
  65. scrollingFrame.ScrollBarImageColor3 = Color3.new((210 / 255), (76 / 255), (71 / 255))
  66. scrollingFrame.ScrollBarThickness = 4
  67. scrollingFrame.ZIndex = 3
  68. -- Configure layout.
  69. uiListLayout.Parent = scrollingFrame
  70. uiListLayout.Padding = UDim.new(0, 10)
  71. uiPadding.Parent = scrollingFrame
  72. uiPadding.PaddingLeft = UDim.new(0.08, 0)
  73. uiPadding.PaddingRight = UDim.new(0.08, 0)
  74. uiPadding.PaddingTop = UDim.new(0, 5)
  75. uiListLayout.Changed:Connect(function()
  76. scrollingFrame.CanvasSize = UDim2.new(0, 0, 0, uiListLayout.AbsoluteContentSize.Y + 10)
  77. end)
  78. cloneGui.scrollingFrame = scrollingFrame
  79. end
  80. function cloneGui.addGrid(grid)
  81. local UIStroke = player.PlayerGui.MainGui.PaintFrame.GridHolder.Grid.UIStroke:Clone()
  82. local container = Instance.new('Frame')
  83. local preview = grid:Clone()
  84. -- Initialize new container.
  85. container.Parent = cloneGui.scrollingFrame
  86. container.Size = UDim2.new(1, 0, 1, 0)
  87. container.SizeConstraint = Enum.SizeConstraint.RelativeXX
  88. container.BackgroundTransparency = 0.8
  89. container.ZIndex = 4
  90. UIStroke.Thickness = 4.5
  91. UIStroke.Parent = container
  92. UIStroke.Enabled = false
  93. -- Clone grid into container.
  94. preview.Parent = container
  95. if (cloneGui.selected == nil) then
  96. cloneGui.selected = container
  97. UIStroke.Enabled = true
  98. end
  99. container.InputBegan:Connect(function(userInput)
  100. if (userInput.UserInputType == Enum.UserInputType.MouseButton1) then
  101. cloneGui.selected.UIStroke.Enabled = false
  102. UIStroke.Enabled = true
  103. cloneGui.selected = container
  104. end
  105. end)
  106. end
  107. function copyGrid()
  108. if (cloneGui.selected ~= nil) then
  109. local target = cloneGui.selected.Grid
  110. local destination = player.PlayerGui.MainGui.PaintFrame.GridHolder.Grid
  111. for i = 1, 1024 do
  112. destination[i].BackgroundColor3 = target[i].BackgroundColor3
  113. end
  114. end
  115. end
  116. function cloneGrid()
  117. local remote = game.ReplicatedStorage.Remotes.CreateArt
  118. local frameColor = "ffffff"
  119. local frame = "Starter Frame"
  120. local name = "a"
  121. local cells = {}
  122. local grid = cloneGui.selected.GridHolder.Grid
  123. for i = 1, 1024 do
  124. cells[i] = grid[i].BackgroundColor3:ToHex()
  125. end
  126. local payload = {}
  127. payload["FrameColor"] = frameColor
  128. payload["Frame"] = frame
  129. payload["Name"] = name
  130. payload["Cells"] = cells
  131. remote:InvokeServer(payload)
  132. end
  133. function refreshGrids()
  134. local objects = game.Workspace.Plots:GetDescendants()
  135. for i, v in ipairs(objects) do
  136. if (v.Name == 'Grid' and v.ClassName == 'Frame' and not collectionService:HasTag(v, 'cloned')) then
  137. if (#v:GetChildren() == 1027) then
  138. collectionService:AddTag(v, 'cloned')
  139. cloneGui.addGrid(v)
  140. end
  141. end
  142. end
  143. end
  144. cloneGui.buildRoot()
  145. cloneGui.buildButtons()
  146. cloneGui.buildScrollingFrame()
  147. while (_G.refreshing) do
  148. refreshGrids()
  149. wait(0.1)
  150. end