Sakkzz

Planks

Nov 11th, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.64 KB | None | 0 0
  1. local service = setmetatable({}, {__index = function(t, k) return game:GetService(k) end })
  2.  
  3. local PlankScreen = Instance.new("ScreenGui")
  4. local PlankFrame = Instance.new("Frame")
  5. local ProcessedWoodList = Instance.new("ScrollingFrame")
  6. local TpAllPlanks = Instance.new("TextButton")
  7. local SellPlanks = Instance.new("TextButton")
  8.  
  9. --Properties:
  10.  
  11. PlankScreen.Name = "PlankScreen"
  12. PlankScreen.Parent = game.CoreGui.LT2.MainFrame.ButtonFrame.TpPlank
  13.  
  14. PlankFrame.Name = "PlankFrame"
  15. PlankFrame.Parent = PlankScreen
  16. PlankFrame.BackgroundColor3 = Color3.new(0.145098, 0.145098, 0.14902)
  17. PlankFrame.BorderColor3 = Color3.new(0, 0, 0)
  18. PlankFrame.BorderSizePixel = 2
  19. PlankFrame.Position = UDim2.new(0, -98, 0, -285)
  20. PlankFrame.Size = UDim2.new(0, 363, 0, 280)
  21.  
  22. ProcessedWoodList.Name = "ProcessedWoodList"
  23. ProcessedWoodList.Parent = PlankFrame
  24. ProcessedWoodList.BackgroundColor3 = Color3.new(0.145098, 0.145098, 0.14902)
  25. ProcessedWoodList.BorderColor3 = Color3.new(0, 0, 0)
  26. ProcessedWoodList.BorderSizePixel = 2
  27. ProcessedWoodList.Size = UDim2.new(0, 363, 0, 210)
  28.  
  29. TpAllPlanks.Name = "TpAllPlanks"
  30. TpAllPlanks.Parent = PlankFrame
  31. TpAllPlanks.BackgroundColor3 = Color3.new(0.054902, 0.054902, 0.0588235)
  32. TpAllPlanks.BorderColor3 = Color3.new(0, 0, 0)
  33. TpAllPlanks.BorderSizePixel = 2
  34. TpAllPlanks.Position = UDim2.new(0, 55, 0, 250)
  35. TpAllPlanks.Size = UDim2.new(0, 250, 0, 20)
  36. TpAllPlanks.Font = Enum.Font.Gotham
  37. TpAllPlanks.Text = "TP ALL PLANKS"
  38. TpAllPlanks.TextColor3 = Color3.new(1, 1, 1)
  39. TpAllPlanks.TextSize = 14
  40.  
  41. SellPlanks.Name = "SellPlanks"
  42. SellPlanks.Parent = PlankFrame
  43. SellPlanks.BackgroundColor3 = Color3.new(0.054902, 0.054902, 0.0588235)
  44. SellPlanks.BorderColor3 = Color3.new(0, 0, 0)
  45. SellPlanks.BorderSizePixel = 2
  46. SellPlanks.Position = UDim2.new(0, 55, 0, 220)
  47. SellPlanks.Size = UDim2.new(0, 250, 0, 20)
  48. SellPlanks.Font = Enum.Font.Gotham
  49. SellPlanks.Text = "SELL ALL PLANKS"
  50. SellPlanks.TextColor3 = Color3.new(1, 1, 1)
  51. SellPlanks.TextSize = 14
  52.  
  53. function Create(cls,props)
  54. local inst = Instance.new(cls)
  55. for i,v in pairs(props) do
  56. inst[i] = v
  57. end
  58. return inst
  59. end
  60. local MoneyCooldown = false
  61. local CurrentSlot = game.Players.LocalPlayer:WaitForChild("CurrentSaveSlot").Value
  62. local ScriptLoadOrSave = false
  63. local CurrentlySavingOrLoading = game.Players.LocalPlayer:WaitForChild("CurrentlySavingOrLoading")
  64. local TreeLogs={}
  65. local WoodPlanks={}
  66. local Render = service.RunService.RenderStepped
  67. local UserInputService = game:GetService("UserInputService")
  68. local shiftKeyL = Enum.KeyCode.LeftShift
  69. local Replicated = service.ReplicatedStorage
  70. local Client = Replicated.Interaction.ClientSetListPlayer
  71. local Dragging = Replicated.Interaction.ClientIsDragging
  72. local Properties = service.Workspace.Properties
  73. local Players = service.Players
  74. local PlayerModels = service.Workspace.PlayerModels
  75. local Player = Players.LocalPlayer
  76. local Char = Player.Character
  77. local Hum = Char.Humanoid
  78. local Root = Char.HumanoidRootPart
  79. local Mouse = Player:GetMouse()
  80. local Noclipper = false
  81. local Open = true
  82. local throwAxe = false
  83. local misc = false
  84. local player = false
  85. local slot = false
  86. local box = false
  87. local log = false
  88. local plank = false
  89. local players = false
  90. local wp = false
  91. local other = false
  92.  
  93. function UpdatePlanks()
  94. local inc = 0
  95. WoodPlanks={}
  96. for i,v in pairs(PlayerModels:GetChildren()) do
  97. if v.Name == "Plank" and v.Owner.Value == Player then
  98. if v:FindFirstChild("TreeClass") and WoodPlanks[v.TreeClass.Value] then
  99. WoodPlanks[v.TreeClass.Value] = WoodPlanks[v.TreeClass.Value]
  100. WoodPlanks[v.TreeClass.Value]["Wood"][v] = v
  101. elseif v:FindFirstChild("TreeClass") then
  102. WoodPlanks[v.TreeClass.Value]={Wood = {v.WoodSection}}
  103. end
  104. end
  105. end
  106. end
  107.  
  108. function UpdateSellPlanks()
  109. local inc = 0
  110. UpdatePlanks()
  111. ProcessedWoodList:ClearAllChildren()
  112. for i,v in pairs(WoodPlanks) do
  113. ProcessedWoodList.CanvasSize=UDim2.new(0,0,0,25*inc)
  114. local SellButton=Create("TextButton",{Parent=ProcessedWoodList,Size=UDim2.new(1,-14,0,20),Position=UDim2.new(0,5,0,35*inc),Text=" "..i,TextXAlignment="Left",ZIndex=3,BorderSizePixel=0})
  115. local Color = Create("Frame",{Parent=ProcessedWoodList,Size=UDim2.new(0,5,0,20),Position=UDim2.new(0,0,0,35*inc),BorderSizePixel=0,ZIndex=3,BackgroundColor3=v["Wood"][1].Color})
  116. SellButton.MouseButton1Click:Connect(function()
  117. for x = 1,100 do
  118. v["Wood"][1].CFrame=CFrame.new(Root.Position + Vector3.new(0, 20, 0))
  119. Dragging:FireServer(v["Wood"][1].Parent)
  120. end
  121. end)
  122. inc = inc + 1
  123. end
  124. inc = 0
  125. end
  126.  
  127. PlayerModels.ChildRemoved:Connect(function(thing)
  128. if thing.Owner.Value == Player then
  129. UpdateSellPlanks()
  130. end
  131. end)
  132.  
  133. UpdateSellPlanks()
  134.  
  135. --- Tp all Planks ---
  136.  
  137. TpAllPlanks.MouseButton1Click:Connect(function()
  138. for _, Plank in pairs(PlayerModels:GetChildren()) do
  139. if Plank.Name == "Plank" and Plank:findFirstChild("Owner") then
  140. if Plank.Owner.Value == Player then
  141. Plank:MoveTo(Root.Position + Vector3.new(0, 20, 0))
  142. for i = 1,100 do
  143. Dragging:FireServer(Plank)
  144. end
  145. end
  146. end
  147. end
  148. end)
  149.  
  150. --- Sell Planks ---
  151.  
  152. SellPlanks.MouseButton1Click:Connect(function()
  153. for _, Plank in pairs(PlayerModels:GetChildren()) do
  154. if Plank.Name == "Plank" and Plank:findFirstChild("Owner") then
  155. if Plank.Owner.Value == Player then
  156. for i,v in pairs(Plank:GetChildren()) do
  157. if v.Name == "WoodSection" then
  158. spawn(function()
  159. for i = 1,10 do
  160. wait()
  161. v.CFrame = CFrame.new(Vector3.new(315, -0.296, 85.791))*CFrame.Angles(math.rad(90),0,0)
  162. end
  163. end)
  164. end
  165. end
  166. spawn(function()
  167. for i = 1,20 do
  168. wait()
  169. Dragging:FireServer(Plank)
  170. end
  171. end)
  172. end
  173. end
  174. end
  175. end)
Add Comment
Please, Sign In to add comment