Advertisement
Pastebloxian

Lumber tycoon auto dupe

Mar 2nd, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.12 KB | None | 0 0
  1. Screen = Instance.new("ScreenGui",game.Players.LocalPlayer.PlayerGui)
  2. Scrolling = Instance.new("ScrollingFrame",Screen)
  3. Scrolling.Size = UDim2.new(0,300,0,500)
  4. Scrolling.CanvasSize = UDim2.new(0,300,3,0)
  5. Exit = Instance.new("TextButton", Scrolling)
  6. Exit.Size = UDim2.new(0,30,0,20)
  7. Exit.Position = UDim2.new(1,-40,0,0)
  8. Exit.Text = "Exit"
  9. DontTP = Instance.new("TextButton", Scrolling)
  10. DontTP.Size = UDim2.new(0,40,0,40)
  11. DontTP.Position = UDim2.new(1,-60,0,50)
  12. DontTP.Text = "Don't TP back"
  13. DontTP.TextWrapped = true
  14. DontTPVar = false
  15. sendNotice = game.ReplicatedStorage.Notices.SendUserNotice
  16. DontTP.MouseButton1Click:connect(function()
  17. DontTPVar = true
  18. end)
  19. Exit.MouseButton1Click:connect(function()
  20. Screen:Destroy()
  21. end)
  22. g = 0
  23. Sniggle = false
  24. function InitButton(ButtonName)
  25. TreeClick = TreeButton.MouseButton1Click:Connect(function()
  26. if game.Players.LocalPlayer.CurrentSaveSlot ~= -1 then
  27. TreeClick:Disconnect()
  28. Scrolling.Visible = false
  29. game.Players.LocalPlayer.PlayerGui.MenuGUI.Open.Visible = false
  30. TP(ButtonName)
  31. else
  32. sendNotice:Fire("You must load/save first!")
  33. end
  34. end)
  35. end
  36. gg = {}
  37. OpenMenu = game.Players.LocalPlayer.PlayerGui.MenuGUI.Open.Changed:connect(function()
  38. if game.Players.LocalPlayer.PlayerGui.MenuGUI.Open.Visible == true then
  39. game.Players.LocalPlayer.PlayerGui.MenuGUI.Open.Visible = false
  40. end
  41. end)
  42. function Start()
  43. Sniggle = true
  44. for i,v in pairs(game.Workspace.PlayerModels:GetChildren()) do
  45. if v:FindFirstChild("Owner") and v.Owner.Value == game.Players.LocalPlayer then
  46. if v:FindFirstChild("TreeClass") then
  47. if Scrolling:FindFirstChild(v.TreeClass.Value) then
  48. if not gg[i] then
  49. Scrolling[v.TreeClass.Value.." Value"].Value = Scrolling[v.TreeClass.Value.." Value"].Value+1
  50. Scrolling[v.TreeClass.Value].Text = v.TreeClass.Value.." ("..Scrolling[v.TreeClass.Value.." Value"].Value..")"
  51. end
  52. else
  53. g = g+1
  54. TreeButton = Instance.new("TextButton",Scrolling)
  55. TreeButton.Size = UDim2.new(0,100,0,50)
  56. TreeButton.Position = UDim2.new(0,10,0,70*g)
  57. TreeButton.Name = v.TreeClass.Value
  58. TreeButton.Text = v.TreeClass.Value.." (1)"
  59. InitButton(TreeButton)
  60. TreeVal = Instance.new("NumberValue",Scrolling)
  61. TreeVal.Name = v.TreeClass.Value.." Value"
  62. TreeVal.Value = 1
  63. gg[i] = v.TreeClass.Value
  64. end
  65. end
  66. end
  67. end
  68. end
  69. if not Sniggle then
  70. Start()
  71. end
  72. --[[game.Workspace.PlayerModels.ChildAdded:connect(function(Item)
  73. Item:WaitForChild("Owner")
  74. if Item.Owner.Value == game.Players.LocalPlayer then
  75. Start()
  76. end
  77. end)]]
  78. game.Workspace.PlayerModels.ChildRemoved:connect(function(Item)
  79. if Item:FindFirstChild("Owner") and Item.Owner.Value == game.Players.LocalPlayer and Item:FindFirstChild("TreeClass") and Scrolling:FindFirstChild(Item.TreeClass.Value.." Value") then
  80. Scrolling[Item.TreeClass.Value.." Value"].Value = Scrolling[Item.TreeClass.Value.." Value"].Value-1
  81. if Scrolling[Item.TreeClass.Value.." Value"].Value == 0 then
  82. Scrolling[Item.TreeClass.Value]:Destroy()
  83. Scrolling[Item.TreeClass.Value.." Value"]:Destroy()
  84. else
  85. Scrolling[Item.TreeClass.Value].Text = Item.TreeClass.Value.." ("..Scrolling[Item.TreeClass.Value.." Value"].Value..")"
  86. end
  87. end
  88. end)
  89.  
  90. function TP(Name)
  91. sendNotice:Fire("Click on a whitelisted base")
  92. local ButtonPress
  93. ButtonPress = game.Players.LocalPlayer:GetMouse().Button1Down:Connect(function()
  94. Square = game.Players.LocalPlayer:GetMouse().Target
  95. if ((Square.Name == "OriginSquare" or Square.Name == "Square") and Square.Parent.Owner.Value ~= game.Players.LocalPlayer and Square.Parent.Owner.Value ~= nil) then
  96. ButtonPress:Disconnect()
  97. sendNotice:Fire("Auto Whitelisted player: "..Square.Parent.Owner.Value.Name,0.8)
  98. game.ReplicatedStorage.Interaction.ClientSetListPlayer:InvokeServer(game.Players.LocalPlayer.WhitelistFolder,Square.Parent.Owner.Value,true)
  99. game.ReplicatedStorage.LoadSaveRequests.RequestSave:InvokeServer(game.Players.LocalPlayer.CurrentSaveSlot.Value)
  100. local success, errorMessage = game.ReplicatedStorage.LoadSaveRequests.RequestLoad:InvokeServer(game.Players.LocalPlayer.CurrentSaveSlot.Value,game.Players.LocalPlayer)
  101. if success then
  102. print'Initial Reload Success'
  103. sendNotice:Fire("Reload success", 0.8)
  104. game.Players.LocalPlayer.CurrentSaveSlot.RobloxLocked = true
  105. game.Players.LocalPlayer.CurrentSaveSlot.Set.RobloxLocked = true
  106. for i,v in pairs(game.Workspace.PlayerModels:GetChildren()) do
  107. print'TPing'
  108. if v:FindFirstChild("TreeClass") and v.TreeClass.Value == Name and v.Owner.Value == game.Players.LocalPlayer then
  109. v:MoveTo(Square.Position)
  110. v.Name = "TpMe"
  111. for i=1,10 do
  112. game:GetService("RunService").RenderStepped:wait()
  113. for i=1,10 do
  114. v.WoodSection.CFrame = CFrame.new(Vector3.new(Square.Position.X,Square.Position.Y+5,Square.Position.Z))*CFrame.Angles(math.rad(90),0,0)
  115. game.ReplicatedStorage.Interaction.ClientIsDragging:FireServer(v)
  116. end
  117. end
  118. end
  119. end
  120. Wait = 0
  121. while Wait < 60 do
  122. Wait = Wait + 1
  123. sendNotice:Fire("Waiting: "..60-Wait,1)
  124. wait(1)
  125. end
  126. local succes, errormessage = game.ReplicatedStorage.LoadSaveRequests.RequestLoad:InvokeServer(game.Players.LocalPlayer.CurrentSaveSlot.Value,game.Players.LocalPlayer)
  127. if succes then
  128. sendNotice:Fire("Reload success", 0.8)
  129. game.Players.LocalPlayer.CurrentSaveSlot.RobloxLocked = false
  130. game.Players.LocalPlayer.CurrentSaveSlot.Set.RobloxLocked = false
  131. if not DontTPVar then
  132. DontTPVar = false
  133. for i,v in pairs(game.Workspace.Properties:GetChildren()) do
  134. if v.Owner and v.Owner.Value == game.Players.LocalPlayer and v:FindFirstChild("OriginSquare") then
  135. Square = v.OriginSquare
  136. for i,v in pairs(game.Workspace.PlayerModels:GetChildren()) do
  137. if v.Name == "TpMe" then
  138. v.Name = "Model"
  139. print'Secondary Reload Success'
  140. game.Players.LocalPlayer.CurrentSaveSlot.RobloxLocked = false
  141. game.Players.LocalPlayer.CurrentSaveSlot.Set.RobloxLocked = false
  142. game.ReplicatedStorage.Interaction.ClientRequestOwnership:FireServer(v)
  143. v:MoveTo(Square.Position)
  144. for i=1,10 do
  145. game:GetService("RunService").RenderStepped:wait()
  146. for i=1,10 do
  147. v.WoodSection.CFrame = (CFrame.new(Vector3.new(Square.Position.X,Square.Position.Y+5,Square.Position.Z))*CFrame.Angles(math.rad(90),0,0))
  148. game.ReplicatedStorage.Interaction.ClientIsDragging:FireServer(v)
  149. end
  150. end
  151. end
  152. end
  153. end
  154. end
  155. end
  156. OpenMenu:Disconnect()
  157. sendNotice:Fire("Duping Done, if you're going to dupe again, you must reload.")
  158. Scrolling.Visible = true
  159. game.Players.LocalPlayer.PlayerGui.MenuGUI.Open.Visible = true
  160. Start()
  161. else
  162. print('Secondary Reload Error: '..errormessage)
  163. sendNotice:Fire(errormessage)
  164. end
  165. else
  166. OOF = true
  167. while OOF do
  168. wait(0.5)
  169. local _,Fail = game.ReplicatedStorage.LoadSaveRequests.RequestLoad:InvokeServer(game.Players.LocalPlayer.CurrentSaveSlot.Value,game.Players.LocalPlayer)
  170. print(string.sub(Fail,49,50))
  171. if tonumber(string.sub(Fail,49,50)) == 1 then
  172. OOF = false
  173. end
  174. print('Initial Reload Error: '..Fail)
  175. Deb = true
  176. sendNotice:Fire("Wait "..string.sub(Fail,49,50),1)
  177. end
  178. if Deb then
  179. Deb = false
  180. TP(Name)
  181. end
  182. end
  183. else
  184. sendNotice:Fire("Something went wrong! Try re-executing.")
  185. game.Players.LocalPlayer.PlayerGui.MenuGUI.Open.Visible = true
  186. end
  187.  
  188. end)
  189.  
  190. end
  191. --game.ReplicatedStorage.Interaction.ClientIsDragging:FireServer()
  192. --v:MoveTo(game.Players.LocalPlayer.Character.Torso.Position)
  193.  
  194. --game.Players.LocalPlayer.PlayerGui.ScreenGui:Destroy()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement