Dragon_Dupe_Channel

BringWoodLah

Jan 3rd, 2023
10,688
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.79 KB | None | 0 0
  1. -- Gui to Lua
  2. -- Version: 1
  3.  
  4. -- Instances:
  5.  
  6. local ScreenGui = Instance.new("ScreenGui")
  7. local Frame = Instance.new("Frame")
  8. local TextLabel = Instance.new("TextLabel")
  9. local ScrollingFrame = Instance.new("ScrollingFrame")
  10. local UIListLayout = Instance.new("UIListLayout")
  11. local UIPadding = Instance.new("UIPadding")
  12.  
  13. --Properties:
  14.  
  15. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  16. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  17.  
  18. Frame.Parent = ScreenGui
  19. Frame.AnchorPoint = Vector2.new(0.5, 0.5)
  20. Frame.BackgroundColor3 = Color3.fromRGB(0, 0, 255)
  21. Frame.BorderColor3 = Color3.fromRGB(255, 0, 0)
  22. Frame.BorderSizePixel = 4
  23. Frame.Position = UDim2.new(0.5, 0, 0.5, 0)
  24. Frame.Size = UDim2.new(0, 186, 0, 250)
  25.  
  26. TextLabel.Parent = Frame
  27. TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  28. TextLabel.BackgroundTransparency = 1.000
  29. TextLabel.BorderSizePixel = 0
  30. TextLabel.Size = UDim2.new(0, 186, 0, 50)
  31. TextLabel.Font = Enum.Font.Bangers
  32. TextLabel.Text = "COOPER TRE GETTR"
  33. TextLabel.TextColor3 = Color3.fromRGB(255, 0, 0)
  34. TextLabel.TextSize = 28.000
  35.  
  36. ScrollingFrame.Parent = Frame
  37. ScrollingFrame.Active = true
  38. ScrollingFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  39. ScrollingFrame.BackgroundTransparency = 1.000
  40. ScrollingFrame.BorderSizePixel = 0
  41. ScrollingFrame.Position = UDim2.new(0, 0, 0.200000003, 0)
  42. ScrollingFrame.Size = UDim2.new(0, 186, 0, 200)
  43. ScrollingFrame.ScrollBarThickness = 2
  44. ScrollingFrame.AutomaticCanvasSize = Enum.AutomaticSize.Y
  45.  
  46. UIPadding.Parent = ScrollingFrame
  47. UIPadding.PaddingBottom = UDim.new(0, 8)
  48.  
  49. UIListLayout.Parent = ScrollingFrame
  50. UIListLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
  51. UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  52. UIListLayout.Padding = UDim.new(0, 8)
  53.  
  54. -- cooper get trre
  55. local cooper = game.Players.LocalPlayer
  56. local treeregins = {}
  57. local treclases = {}
  58. local replicatedfarts = game.ReplicatedStorage
  59. local axeclasses = replicatedfarts:WaitForChild("AxeClasses")
  60.  
  61. for _, cooper in next, workspace:GetChildren() do
  62. if cooper.Name == "TreeRegion" then
  63. table.insert(treeregins, cooper)
  64. end
  65. end
  66.  
  67. for _, cooper in next, treeregins do
  68. for _, cooper in next, cooper:GetChildren() do
  69. if cooper:FindFirstChild("TreeClass") and not table.find(treclases, cooper.TreeClass.Value) then
  70. table.insert(treclases, cooper.TreeClass.Value)
  71. end
  72. end
  73. end
  74.  
  75. function getAxStats(axName, treClas)
  76. local coopermodule = axeclasses:FindFirstChild("AxeClass_"..axName)
  77. if not coopermodule then return end
  78. local axStats = require(coopermodule).new()
  79. if axStats.SpecialTrees and axStats.SpecialTrees[treClas] then
  80. for mini, cooper in next, axStats.SpecialTrees[treClas] do
  81. axStats[mini] = cooper
  82. end
  83. end
  84. return axStats
  85. end
  86.  
  87. function getModlMass(model)
  88. local total = 0
  89. local woodsextions = 0
  90. for _, v in next, model:GetDescendants() do
  91. if v:IsA("BasePart") and v.Name ~= "Leaves" then
  92. if v.Name == "WoodSection" then woodsextions = woodsextions + 1 end
  93. total = total + v.Mass
  94. end
  95. end
  96. return total, woodsextions
  97. end
  98.  
  99. function getTrreOfClas(clas)
  100. local posibilitys = {}
  101. for _, cooper1 in next, treeregins do
  102. for _, cooper2 in next, cooper1:GetChildren() do
  103. if cooper2:IsA("Model") and cooper2:FindFirstChild("CutEvent") then
  104. local trreclas = cooper2:FindFirstChild("TreeClass")
  105. local onwer = cooper2:FindFirstChild("Owner")
  106. if onwer and trreclas and onwer.Value == nil and trreclas.Value == clas then
  107. local mas, secs = getModlMass(cooper2)
  108. if secs > 1 then
  109. table.insert(posibilitys, {
  110. tre = cooper2,
  111. mass = mas
  112. })
  113. end
  114. end
  115. end
  116. end
  117. end
  118. table.sort(posibilitys, function(cooper1, cooper2)
  119. return cooper1.mass > cooper2.mass
  120. end)
  121. return posibilitys[1] and posibilitys[1].tre or false, "No tree found."
  122. end
  123.  
  124. function choppy(tre, ax)
  125. task.wait()
  126. cooper.Character.HumanoidRootPart.CFrame = CFrame.new(tre.WoodSection.Position + Vector3.new(5, 0, 0))
  127. task.wait(0.25)
  128. local axStats = getAxStats(ax.ToolName.Value, tre.TreeClass.Value)
  129. local propertys = {
  130. tool = ax,
  131. height = 0.3,
  132. faceVector = Vector3.new(1, 0, 0),
  133. sectionId = 1,
  134. hitPoints = axStats.Damage,
  135. cooldown = axStats.SwingCooldown,
  136. cuttingClass = "Axe"
  137. }
  138.  
  139. local newtre, trecon = nil, nil
  140. trecon = workspace.LogModels.ChildAdded:Connect(function(tre)
  141. task.wait()
  142. if tre.Owner.Value == cooper then
  143. newtre = tre
  144. trecon:Disconnect()
  145. trecon = nil
  146. end
  147. end)
  148. repeat
  149. replicatedfarts.Interaction.RemoteProxy:FireServer(tre.CutEvent, propertys)
  150. task.wait(axStats.SwingCooldown)
  151. until newtre ~= nil
  152. return newtre
  153. end
  154.  
  155. function hahafunnygod()
  156. local rootjoint = cooper.Character.HumanoidRootPart.RootJoint
  157. rootjoint:Clone().Parent = rootjoint.Parent
  158. rootjoint:Destroy()
  159. task.wait()
  160. end
  161.  
  162. function bringy(treclas)
  163. local curpos = cooper.Character.HumanoidRootPart.CFrame
  164. cooper.Character.Humanoid:UnequipTools()
  165. task.wait()
  166. local axs = {}
  167. for _, cooper in next, cooper.Backpack:GetChildren() do
  168. if cooper.Name ~= "BlueprintTool" and cooper:FindFirstChild("ToolName") then
  169. table.insert(axs, {
  170. ax = cooper,
  171. stats = getAxStats(cooper.ToolName.Value, treclass)
  172. })
  173. end
  174. end
  175. if #axs == 0 then return false, "Pleas pickup a ax." end
  176. table.sort(axs, function(cooper1, cooper2)
  177. return cooper1.stats.Damage > cooper2.stats.Damage
  178. end)
  179. local ax = axs[1].ax
  180. local tre, msg = getTrreOfClas(treclas)
  181. if not tre then
  182. return false, msg
  183. end
  184. if treclas == "LoneCave" then
  185. if ax.ToolName.Value ~= "EndTimesAxe" then
  186. return false, "2 get this tre u need end axe loser."
  187. end
  188. hahafunnygod()
  189. end
  190. local loptp = nil
  191. if treclas ~= "LoneCave" then
  192. loptp = game["Run Service"].Heartbeat:Connect(function()
  193. cooper.Character.HumanoidRootPart.CFrame = CFrame.new(tre.WoodSection.Position + Vector3.new(5, 3, 0))
  194. end)
  195. end
  196. tre = choppy(tre, ax)
  197. if treclas ~= "LoneCave" then
  198. loptp:Disconnect()
  199. loptp = nil
  200. end
  201. task.wait(0.15)
  202. task.spawn(function()
  203. for cooper=1, 60 do
  204. replicatedfarts.Interaction.ClientIsDragging:FireServer(tre)
  205. task.wait()
  206. end
  207. end)
  208. task.wait(0.1)
  209. tre.PrimaryPart = tre.WoodSection
  210. for i=1, 60 do
  211. tre.PrimaryPart.Velocity = Vector3.new(0, 0, 0)
  212. tre:PivotTo(curpos)
  213. task.wait()
  214. end
  215. if treclas == "LoneCave" then
  216. cooper.Character.Humanoid:UnequipTools()
  217. task.wait()
  218. cooper.Character.Head:Destroy()
  219. cooper.CharacterAdded:Wait()
  220. task.wait(1.5)
  221. end
  222. cooper.Character.HumanoidRootPart.CFrame = tre.WoodSection.CFrame
  223. return true, "Don get tre!"
  224. end
  225.  
  226. local notfy = function(titl, tex, durashin)
  227. game:GetService("StarterGui"):SetCore("SendNotification", {
  228. Title = titl,
  229. Text = tex,
  230. Duration = durashin,
  231. })
  232. end
  233.  
  234. local addtre = function(tre)
  235. local TreBButon = Instance.new("TextButton")
  236. TreBButon.Name = "TreBButon"
  237. TreBButon.Parent = ScrollingFrame
  238. TreBButon.BackgroundColor3 = Color3.fromRGB(255, 0, 4)
  239. TreBButon.Position = UDim2.new(0.0483870953, 0, 0, 0)
  240. TreBButon.Size = UDim2.new(0, 168, 0, 36)
  241. TreBButon.Font = Enum.Font.Bangers
  242. TreBButon.Text = tre
  243. TreBButon.TextColor3 = Color3.fromRGB(0, 0, 255)
  244. TreBButon.TextScaled = true
  245. TreBButon.TextSize = 28.000
  246. TreBButon.TextWrapped = true
  247. TreBButon.MouseButton1Click:Connect(function()
  248. local suces, mesg = bringy(tre)
  249. if suces == true then
  250. notfy("Suces!", mesg, 5)
  251. elseif not (suces == true) then
  252. notfy("Not suces!", mesg, 5)
  253. end
  254. end)
  255. end
  256.  
  257. for _, cooper in next, treclases do
  258. addtre(cooper)
  259. end
  260.  
  261. local UserInputService = game:GetService("UserInputService")
  262.  
  263. local gui = Frame
  264.  
  265. local dragging
  266. local dragInput
  267. local dragStart
  268. local startPos
  269.  
  270. local function update(input)
  271. local delta = input.Position - dragStart
  272. gui.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  273. end
  274.  
  275. gui.InputBegan:Connect(function(input)
  276. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  277. dragging = true
  278. dragStart = input.Position
  279. startPos = gui.Position
  280.  
  281. input.Changed:Connect(function()
  282. if input.UserInputState == Enum.UserInputState.End then
  283. dragging = false
  284. end
  285. end)
  286. end
  287. end)
  288.  
  289. gui.InputChanged:Connect(function(input)
  290. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  291. dragInput = input
  292. end
  293. end)
  294.  
  295. UserInputService.InputChanged:Connect(function(input)
  296. if input == dragInput and dragging then
  297. update(input)
  298. end
  299. end)
Add Comment
Please, Sign In to add comment