StenHisDirt

Tree aura

Oct 21st, 2019
92
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Credits to Johiro
  2. --If you decide to skid something then atleast give credits
  3. local function GetDamage(Axe, TreeClass)
  4. if Axe.ToolTip == "Basic Hatchet" then return 0.2
  5. elseif Axe.ToolTip == "Plain Axe" then return 0.55
  6. elseif Axe.ToolTip == "Steel Axe" then return 0.93
  7. elseif Axe.ToolTip == "Hardened Axe" then return 1.45
  8. elseif Axe.ToolTip == "Silver Axe" then return 1.6
  9. elseif Axe.ToolTip == "Rukiryaxe" then return 1.68
  10. elseif Axe.ToolTip == "Beta Axe of Bosses" then return 1.45
  11. elseif Axe.ToolTip == "Alpha Axe of Testing" then return 1.5
  12. elseif Axe.ToolTip == "Fire Axe" then
  13. if TreeClass ~= "Volcano" then return 0.6 else return 6.35 end
  14. elseif Axe.ToolTip == "End Times Axe" then
  15. if TreeClass ~= "LoneCave" then return 1.58 else return 10000000 end
  16. elseif Axe.ToolTip == "Candy Cane Axe" then return 0
  17. elseif Axe.ToolTip == "Johiro" then return 1.8
  18. elseif Axe.ToolTip == "Beesaxe" then return 1.4
  19. elseif Axe.ToolTip == "CHICKEN AXE" then return 0.9
  20. elseif Axe.ToolTip == "Amber Axe" then return 3.39
  21. elseif Axe.ToolTip == "The Many Axe" then return 10.2
  22. elseif Axe.ToolTip == "Gingerbread Axe" then
  23. if TreeClass == "Walnut" then return 8.5
  24. elseif TreeClass == "Koa" then return 11 else return 1.2 end
  25. elseif Axe.ToolTip == "Bird Axe" then
  26. if TreeClass ~= "Volcano" and TreeClass ~= "CaveCrawler" then return 0.5 else return 0.4 end
  27. end
  28. end
  29. _G.TreeList = {}
  30. for a,b in pairs(workspace:GetChildren()) do
  31. if b.name == "TreeRegion" then
  32. b.ChildAdded:Connect(function(NewTree)--Creates functions that Adds new trees to the list
  33. table.insert(_G.TreeList, NewTree)
  34. end)
  35. for c,d in pairs(b:GetChildren()) do-- Adds the trees when first time starting the script
  36. if d.Name == "Model" then
  37. table.insert(_G.TreeList, d)
  38. end
  39. end
  40. end
  41. end
  42. local function CutTree(Tree)
  43. if GetAxe() ~= false then --checks if you have a axe equiped
  44. Damage = GetDamage(GetAxe(), Tree.TreeClass.Value) --gets the Damage
  45. local CutArguments = {
  46. sectionId = 1,
  47. faceVector = Vector3.new(0,0,-1),
  48. height = 0.5,
  49. hitPoints = Damage,
  50. cooldown = 0,
  51. cuttingClass = "Axe",
  52. tool = GetAxe()
  53. }
  54. for i=1, 50 do
  55. game.ReplicatedStorage.Interaction.RemoteProxy:FireServer(Tree.CutEvent, CutArguments)
  56. end
  57. end
  58. end
  59. spawn(function()
  60. CutEnabled = false
  61. while wait(.5) do
  62. if CutEnabled == true then
  63. if GetAxe() ~= false then
  64. for a,b in pairs(_G.TreeList) do
  65. if not b:FindFirstChild("RootCut") and b:FindFirstChild("CutEvent") then
  66. distance = (game.Players.LocalPlayer.Character.Head.Position - b.WoodSection.Position).magnitude
  67. if distance < 225 then
  68. CutTree(b)
  69. end
  70. else
  71. table.remove(_G.TreeList, a)
  72. end
  73. end
  74. end
  75. end
  76. end
  77. end)
  78.  
  79. OffT.MouseButton1Click:connect(function()
  80. if CutEnabled == true then
  81. CutEnabled = false
  82. elseif CutEnabled == false then
  83. CutEnabled = true
  84. end
  85. end)
  86. OnT.MouseButton1Click:connect(function()
  87. if CutEnabled == true then
  88. CutEnabled = false
  89. elseif CutEnabled == false then
  90. CutEnabled = true
  91. end
  92. end)
RAW Paste Data