Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.45 KB | None | 0 0
  1. --// Gui
  2. for i,v in pairs(game.CoreGui:GetChildren()) do if v.Name == "PlotCopier" then v:Destroy() end end
  3. local ScreenGui = Instance.new("ScreenGui", game.CoreGui)
  4. ScreenGui.Name = "PlotCopier"
  5. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  6. ScreenGui.ResetOnSpawn = false
  7.  
  8. local Frame = Instance.new("Frame", ScreenGui)
  9. Frame.AnchorPoint = Vector2.new(0.5, 0.5)
  10. Frame.BackgroundColor3 = Color3.fromRGB(53, 53, 53)
  11. Frame.BorderSizePixel = 0
  12. Frame.LayoutOrder = 2
  13. Frame.Position = UDim2.new(0.5, 0, 0.5, 0)
  14. Frame.Size = UDim2.new(0, 252, 0, 120)
  15. Frame.Active = true
  16. Frame.Draggable = true
  17.  
  18. local Username = Instance.new("TextBox", Frame)
  19. Username.Name = "Username"
  20. Username.BackgroundColor3 = Color3.fromRGB(98, 98, 98)
  21. Username.BorderSizePixel = 0
  22. Username.Position = UDim2.new(0.0793650821, 0, 0.127244607, 0)
  23. Username.Size = UDim2.new(0, 141, 0, 26)
  24. Username.Font = Enum.Font.GothamBold
  25. Username.PlaceholderColor3 = Color3.fromRGB(255, 255, 255)
  26. Username.PlaceholderText = "Username"
  27. Username.Text = ""
  28. Username.TextColor3 = Color3.fromRGB(255, 255, 255)
  29. Username.TextSize = 19.000
  30. Username.TextWrapped = true
  31.  
  32. local Copy = Instance.new("TextButton", Frame)
  33. Copy.Name = "Copy"
  34. Copy.BackgroundColor3 = Color3.fromRGB(80, 80, 80)
  35. Copy.BorderSizePixel = 0
  36. Copy.Position = UDim2.new(0.0793650821, 0, 0.401305377, 0)
  37. Copy.Size = UDim2.new(0, 212, 0, 25)
  38. Copy.Font = Enum.Font.GothamBold
  39. Copy.Text = "Copy Plot"
  40. Copy.TextColor3 = Color3.fromRGB(0, 218, 0)
  41. Copy.TextSize = 19.000
  42. Copy.TextStrokeColor3 = Color3.fromRGB(0, 76, 0)
  43. Copy.TextStrokeTransparency = 0.000
  44. Copy.TextWrapped = true
  45.  
  46. local Cancel = Instance.new("TextButton", Frame)
  47. Cancel.Name = "Cancel"
  48. Cancel.BackgroundColor3 = Color3.fromRGB(80, 80, 80)
  49. Cancel.BorderSizePixel = 0
  50. Cancel.Position = UDim2.new(0.0793650821, 0, 0.669195354, 0)
  51. Cancel.Size = UDim2.new(0, 212, 0, 25)
  52. Cancel.Font = Enum.Font.GothamBold
  53. Cancel.Text = "Cancel"
  54. Cancel.TextColor3 = Color3.fromRGB(170, 0, 0)
  55. Cancel.TextSize = 19.000
  56. Cancel.TextStrokeColor3 = Color3.fromRGB(83, 0, 0)
  57. Cancel.TextStrokeTransparency = 0.000
  58. Cancel.TextWrapped = true
  59.  
  60. local Delay = Instance.new("TextBox", Frame)
  61. Delay.Name = "Delay"
  62. Delay.BackgroundColor3 = Color3.fromRGB(98, 98, 98)
  63. Delay.BorderSizePixel = 0
  64. Delay.Position = UDim2.new(0.666666687, 0, 0.127244607, 0)
  65. Delay.Size = UDim2.new(0, 64, 0, 26)
  66. Delay.Font = Enum.Font.GothamBold
  67. Delay.PlaceholderColor3 = Color3.fromRGB(255, 255, 255)
  68. Delay.PlaceholderText = "Delay"
  69. Delay.Text = ""
  70. Delay.TextColor3 = Color3.fromRGB(255, 255, 255)
  71. Delay.TextSize = 19.000
  72. Delay.TextWrapped = true
  73.  
  74. --// Functions
  75. local Stamp = game.ReplicatedStorage.BuildingBridge.Stamp
  76.  
  77. function findPlot(n)
  78. for _,v in pairs(workspace.BuildingAreas:GetChildren()) do
  79. if v.Player.Value == n then
  80. return v.PlayerArea
  81. end
  82. end
  83. return nil
  84. end
  85. local Base = findPlot(game.Players.LocalPlayer.Name).BasePlate
  86.  
  87. function getModels(p)
  88. local t = {}
  89. for i,v in pairs(p:GetChildren()) do
  90. if v:IsA("Model") and v:FindFirstChild("SaveCFrame") then
  91. t[i - 1] = {AssetId = v.AssetId.Value, SaveCFrame = v.SaveCFrame.Value}
  92. end
  93. end
  94. return t
  95. end
  96.  
  97. function findTime(s)
  98. return string.format("%02i:%02i:%02i", s/60^2, s/60%60, s%60)
  99. end
  100.  
  101. local Debounce = false
  102. local Copying = false
  103. Copy.MouseButton1Click:Connect(function()
  104. local d = tonumber(Delay.Text)
  105. if not Debounce then
  106. Debounce = true
  107. Copy.Text = "Initializing..."
  108. wait(1.5)
  109. local p = findPlot(Username.Text)
  110. if p == nil then
  111. Copy.Text = "Player Not Found!"
  112. wait(1.5)
  113. Copy.Text = "Copy Plot"
  114. Debounce = false
  115. return
  116. end
  117. Copying = true
  118. local Models = getModels(p)
  119. local Amount = #Models
  120. if Amount <= 1 then
  121. Copy.Text = "Nothing To Copy!"
  122. wait(1.5)
  123. Copy.Text = "Copy Plot"
  124. Debounce = false
  125. return
  126. end
  127. local Time = tick()
  128. local bc = p.BasePlate.CFrame
  129. local i = 1
  130. repeat
  131. if Models[i] ~= nil and Models[i].SaveCFrame ~= nil then
  132. local cs = bc:ToObjectSpace(Models[i].SaveCFrame)
  133. local c = Base.CFrame:ToWorldSpace(cs)
  134. Stamp:InvokeServer(Models[i].AssetId, c)
  135. end
  136. Copy.Text = i.."/"..Amount
  137. i = i + 1
  138. if d ~= nil and d > 0 then wait(d) end
  139. until i == Amount or not Copying
  140. Copy.Text = "Finished! | "..findTime(tick() - Time)
  141. Copying = false
  142. Time = nil
  143. wait(2)
  144. Copy.Text = "Copy Plot"
  145. Debounce = false
  146. end
  147. end)
  148.  
  149. Cancel.MouseButton1Click:Connect(function()
  150. if Copying then
  151. Copying = false
  152. end
  153. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement