Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _G.Active = true
- local Tree = "Sun Tree" -- "Sun Tree", "Feather Tree", "Small Tree", "Swoll Tree", "Big Bush", "Bush", "Feather Bush", "Sun Shrub"
- local LeavesFoliage = "Foliage" -- Big/Small Trees have "Foliage", Big Bushes have "Foliage", Bushes have "Leaves", Shrubs have "Leaves"
- local Objects;
- local Pickup = function(Character)
- local myPos = Character.HumanoidRootPart.Position
- local Objects = {}
- for i,v in pairs(workspace:GetChildren()) do
- if v:FindFirstChild("Pickup") ~= nil and v.ClassName == "Part" then
- local Pos = v.Position
- local Distance = (myPos - Pos).magnitude
- if Distance < 40 then
- table.insert(Objects, v)
- end
- elseif v:FindFirstChild("Pickup") ~= nil and v:FindFirstChild("Part") ~= nil and v.Part.ClassName == "Part" then
- local Pos = v.Part.Position
- local Distance = (myPos - Pos).magnitude
- if Distance < 40 then
- table.insert(Objects, v)
- end
- elseif v:FindFirstChild("Pickup") ~= nil and v.ClassName == "UnionOperation" then
- local Pos = v.Position
- local Distance = (myPos - Pos).magnitude
- if Distance < 40 then
- table.insert(Objects, v)
- end
- end
- end
- for i,v in pairs(Objects) do
- for i=1,10 do
- v.Position = myPos
- game:GetService("ReplicatedStorage").Events.Pickup:FireServer(v)
- end
- end
- end
- --- MAIN CODE ---
- while(_G.Active == true) do
- local tree = game.workspace:FindFirstChild(Tree)
- local Text = tonumber(game.Players.LocalPlayer.PlayerGui.MainGui.Panels.Target.HealthBackdrop.HealthLabel.Text)
- print(Text)
- if (Text > 0) then
- game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(tree[LeavesFoliage].Position) + Vector3.new(0,1.5,0)
- local part = tree[LeavesFoliage]
- local one = game:GetService("ReplicatedStorage").RelativeTime.Value
- local two = {part,part,part,part}
- game:GetService("ReplicatedStorage").Events.SwingTool:FireServer(one, two)
- elseif (Text <= 0) then
- wait(.2)
- Pickup(game.Players.LocalPlayer.Character)
- wait(.2)
- Pickup(game.Players.LocalPlayer.Character)
- wait(.2)
- game.Players.LocalPlayer.PlayerGui.MainGui.Panels.Target.HealthBackdrop.HealthLabel.Text = "40"
- wait(.4)
- end
- wait(.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement