Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. _G.Active = true
  2. local Tree = "Sun Tree" -- "Sun Tree", "Feather Tree", "Small Tree", "Swoll Tree", "Big Bush", "Bush", "Feather Bush", "Sun Shrub"
  3. local LeavesFoliage = "Foliage" -- Big/Small Trees have "Foliage", Big Bushes have "Foliage", Bushes have "Leaves", Shrubs have "Leaves"
  4.  
  5. local Objects;
  6.  
  7. local Pickup = function(Character)
  8. local myPos = Character.HumanoidRootPart.Position
  9. local Objects = {}
  10. for i,v in pairs(workspace:GetChildren()) do
  11. if v:FindFirstChild("Pickup") ~= nil and v.ClassName == "Part" then
  12. local Pos = v.Position
  13. local Distance = (myPos - Pos).magnitude
  14. if Distance < 40 then
  15. table.insert(Objects, v)
  16. end
  17. elseif v:FindFirstChild("Pickup") ~= nil and v:FindFirstChild("Part") ~= nil and v.Part.ClassName == "Part" then
  18. local Pos = v.Part.Position
  19. local Distance = (myPos - Pos).magnitude
  20. if Distance < 40 then
  21. table.insert(Objects, v)
  22. end
  23. elseif v:FindFirstChild("Pickup") ~= nil and v.ClassName == "UnionOperation" then
  24. local Pos = v.Position
  25. local Distance = (myPos - Pos).magnitude
  26. if Distance < 40 then
  27. table.insert(Objects, v)
  28. end
  29. end
  30. end
  31. for i,v in pairs(Objects) do
  32. for i=1,10 do
  33. v.Position = myPos
  34. game:GetService("ReplicatedStorage").Events.Pickup:FireServer(v)
  35. end
  36. end
  37. end
  38.  
  39. --- MAIN CODE ---
  40.  
  41. while(_G.Active == true) do
  42. local tree = game.workspace:FindFirstChild(Tree)
  43. local Text = tonumber(game.Players.LocalPlayer.PlayerGui.MainGui.Panels.Target.HealthBackdrop.HealthLabel.Text)
  44. print(Text)
  45.  
  46. if (Text > 0) then
  47. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(tree[LeavesFoliage].Position) + Vector3.new(0,1.5,0)
  48. local part = tree[LeavesFoliage]
  49. local one = game:GetService("ReplicatedStorage").RelativeTime.Value
  50. local two = {part,part,part,part}
  51. game:GetService("ReplicatedStorage").Events.SwingTool:FireServer(one, two)
  52. elseif (Text <= 0) then
  53. wait(.2)
  54. Pickup(game.Players.LocalPlayer.Character)
  55. wait(.2)
  56. Pickup(game.Players.LocalPlayer.Character)
  57. wait(.2)
  58. game.Players.LocalPlayer.PlayerGui.MainGui.Panels.Target.HealthBackdrop.HealthLabel.Text = "40"
  59. wait(.4)
  60. end
  61. wait(.1)
  62. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement