Advertisement
Guest User

axes

a guest
Mar 28th, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. spawn(function()
  2. --Credits to Johiro, if you decide to skid atleast give credits
  3. GAxe = false
  4. function GetAxe() --Gets your current axe thats equiped when called
  5. if game.Players.LocalPlayer.Character:FindFirstChild("Tool") then
  6. return game.Players.LocalPlayer.Character.Tool --returns the axe when found
  7. else
  8. return false --returns false when not equiped
  9. end
  10. end
  11.  
  12. function GetDamage(Axe, TreeClass)-- Gets the right Damage of the axe and returns it if called to prevent killing yourself like gold axe
  13. if Axe.ToolTip == "Basic Hatchet" then return 0.2
  14. elseif Axe.ToolTip == "Plain Axe" then return 0.55
  15. elseif Axe.ToolTip == "Steel Axe" then return 0.93
  16. elseif Axe.ToolTip == "Hardened Axe" then return 1.45
  17. elseif Axe.ToolTip == "Silver Axe" then return 1.6
  18. elseif Axe.ToolTip == "Rukiryaxe" then return 1.68
  19. elseif Axe.ToolTip == "Beta Axe of Bosses" then return 1.45
  20. elseif Axe.ToolTip == "Alpha Axe of Testing" then return 1.5
  21. elseif Axe.ToolTip == "Fire Axe" then
  22. if TreeClass ~= "Volcano" then return 0.6 else return 6.35 end
  23. elseif Axe.ToolTip == "End Times Axe" then
  24. if TreeClass ~= "LoneCave" then return 1.58 else return 10000000 end
  25. elseif Axe.ToolTip == "Candy Cane Axe" then return 0
  26. elseif Axe.ToolTip == "Johiro" then return 1.8
  27. elseif Axe.ToolTip == "Beesaxe" then return 1.4
  28. elseif Axe.ToolTip == "CHICKEN AXE" then return 0.9
  29. elseif Axe.ToolTip == "Amber Axe" then return 3.39
  30. elseif Axe.ToolTip == "The Many Axe" then return 10.2
  31. elseif Axe.ToolTip == "Gingerbread Axe" then
  32. if TreeClass == "Walnut" then return 8.5
  33. elseif TreeClass == "Koa" then return 11 else return 1.2 end
  34. elseif Axe.ToolTip == "Bird Axe" then
  35. if TreeClass == "Volcano" then return 2.5 elseif TreeClass == "CaveCrawler" then return 3.9 else return 1.65 end
  36. end
  37. end
  38.  
  39.  
  40. function GCut(TreePart) --Cuts the tree when called with the tree you want to cut
  41. if GetAxe() ~= false then --checks if you have a axe equiped
  42. Damage = GetDamage(GetAxe(), TreePart.Parent.TreeClass.Value) --gets the Damage
  43. Height = TreePart.CFrame:pointToObjectSpace(mouse.Hit.p).Y + TreePart.Size.Y/2 --Gets the Height
  44. local CutArguments = {
  45. sectionId = TreePart.ID.Value,
  46. faceVector = Vector3.new(0,0,-1),
  47. height = Height,
  48. hitPoints = Damage,
  49. cooldown = 0,
  50. cuttingClass = "Axe",
  51. tool = GetAxe()
  52. }
  53. for i=1, 50 do
  54. game.ReplicatedStorage.Interaction.RemoteProxy:FireServer(TreePart.Parent.CutEvent, CutArguments)
  55. end
  56. end
  57. end
  58.  
  59. function CutTree(Tree) --Cuts the tree when called with the tree you want to cut
  60. if GetAxe() ~= false then --checks if you have a axe equiped
  61. Damage = GetDamage(GetAxe(), Tree.TreeClass.Value) --gets the Damage
  62. local CutArguments = {
  63. sectionId = 1,
  64. faceVector = Vector3.new(0,0,-1),
  65. height = 0.5,
  66. hitPoints = Damage,
  67. cooldown = 0,
  68. cuttingClass = "Axe",
  69. tool = GetAxe()
  70. }
  71. for i=1, 50 do
  72. game.ReplicatedStorage.Interaction.RemoteProxy:FireServer(Tree.CutEvent, CutArguments)
  73. end
  74. end
  75. end
  76.  
  77. TreeList = {} --Creates a table of the trees
  78. for a,b in pairs(workspace:GetChildren()) do
  79. if b.name == "TreeRegion" then
  80. b.ChildAdded:Connect(function(NewTree)--Creates functions that Adds new trees to the list
  81. table.insert(TreeList, NewTree)
  82. end)
  83. for c,d in pairs(b:GetChildren()) do-- Adds the trees when first time starting the script
  84. if d.Name == "Model" then
  85. table.insert(TreeList, d)
  86. end
  87. end
  88. end
  89. end
  90.  
  91. spawn(function() --used spawn so it wont interrupt any of the other things
  92. CutEnabled = false
  93. while wait(.5) do --Main loop to do the stuff
  94. if CutEnabled == true then
  95. if GetAxe() ~= false then --Checks if you have a axe equiped
  96. for a,b in pairs(TreeList) do
  97. if not b:FindFirstChild("RootCut") and b:FindFirstChild("CutEvent") then --Checks if the tree is already cut
  98. distance = (game.Players.LocalPlayer.Character.Head.Position - b.WoodSection.Position).magnitude --gets the distance between player and tree
  99. if distance < 225 then --if distance lower than 225 then it will cut the tree
  100. CutTree(b) --Calls the function with the tree to cut
  101. end
  102. else
  103. table.remove(TreeList, a)--if tree already cut then it gets removed from the list
  104. end
  105. end
  106. end
  107. end
  108. end
  109. end)
  110.  
  111. mouse = game.Players.LocalPlayer:GetMouse() --Gets the Mouse
  112. mouse.Button1Down:connect(function()
  113. if GAxe == true and GetAxe() ~= false then
  114. Target = mouse.Target
  115. GCut(Target)
  116. end
  117. end)
  118. --Credits to Johiro, if you decide to skid atleast give credits
  119. end)
  120. makesound("rbxassetid://156785206")
  121. if GAxe == true then
  122. GAxe = false
  123. Goldaxe.Text = "Gold Axe Off"
  124. Goldaxe.TextColor3 = Color3.new(255, 0, 0)
  125. elseif GAxe == false then
  126. GAxe = true
  127. Goldaxe.Text = "Gold Axe On"
  128. Goldaxe.TextColor3 = Color3.new(0, 1, 0)
  129. --Credits to Johiro
  130. end
  131. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement