Advertisement
_Thanh_Thy_Cute_

Timber AUTO FARM GUI

Jun 27th, 2021
3,079
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. local functions={};
  2. getgenv().Farm=true;
  3. functions.Teleport=function(cf)
  4. game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame=CFrame.new(cf);
  5. end;
  6.  
  7. functions.getPlot=function()
  8. for _,plot in next,workspace.Plots:children()do
  9. if tostring(plot.Owner.Value)==tostring(game.Players.LocalPlayer)then
  10. return plot;
  11. end;
  12. end;
  13. return false;
  14. end;
  15.  
  16. functions.getTrees=function()
  17. local plot,treeTable=functions.getPlot(),{};
  18. for _,plotModel in next,plot:children()do
  19. if plotModel:IsA'Model'then
  20. for _,tree in next,plotModel:children()do
  21. if tree:IsA'Model'and string.find(tree.Name,"Tree")and not table.find(treeTable,tree)then
  22. table.insert(treeTable,tree);
  23. end;
  24. end;
  25. end;
  26. end;
  27. return treeTable
  28. end;
  29.  
  30. functions.autoFarmTrees=function()
  31. for _,tree in next,functions.getTrees()do
  32. if string.find(tree.Name,"Tree")and not tree:FindFirstChild'Inner'and tree.Parent~=nil and tree:FindFirstChild'MeshPart'and getgenv().Farm then
  33. local connection;
  34. connection=tree.AncestryChanged:Connect(function()
  35. connection:Disconnect();
  36. connection=nil;
  37. end);
  38. functions.Teleport(tree.MeshPart.CFrame.p);
  39. repeat
  40. game:GetService'RunService'.Heartbeat:wait();
  41. game:GetService'ReplicatedStorage'.Communication.Remotes.HitTree:FireServer(tonumber(functions.getPlot().Name),tostring(tree.Parent),tonumber(string.sub(tree.Name,6,6)));
  42. until not connection;
  43. end;
  44. end;
  45. end;
  46.  
  47. while getgenv().Farm do
  48. game:GetService'RunService'.Heartbeat:wait();
  49. functions.autoFarmTrees();
  50. functions.Teleport(functions.getPlot()["0_0"].Sell.CFrame.p+Vector3.new(0,1,0));
  51. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement