The text below is selected, press Ctrl+C to copy to your clipboard. (⌘+C on Mac) No line numbers will be copied.
Guest
Autofarm and Auto collect script pastebin roblox
By Autofarm and Auto collect on 2024-09-21 08:00 am | Syntax: LUA | Views: 11



New Script | Raw | Show/Hide line no. | Copy text to clipboard
  1. --  | Variables | --
  2.  
  3. local root = game:GetService("Players").LocalPlayer.Character.HumanoidRootPart
  4.  
  5. _G.autofarm = true
  6. _G.autocollect = true
  7.  
  8.  
  9. ---------------------------------------------
  10.  
  11.  
  12. -- | Script | --
  13.  
  14. function getclosestbox()
  15.     local dist,box = math.huge
  16.     for i,v in pairs(game:GetService("Workspace").Map.Worlds:GetDescendants()) do
  17.         if v:IsA("MeshPart") and v.Parent.Name == "Boxes" and v.Parent:IsA("Folder") then
  18.             local magnitude = (root.Position - v.Position).magnitude
  19.             if magnitude < dist then
  20.                 dist = magnitude
  21.                 box = v
  22.             end
  23.         end
  24.     end
  25.     return box
  26. end
  27.  
  28.  
  29.  
  30. function autocollect()
  31.     if _G.autocollect then
  32.     for i,v in pairs(game:GetService("Workspace").Map.Orbs:GetChildren()) do
  33.        v.CFrame = CFrame.new(root.Position)
  34.        end
  35.     end
  36. end
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43. while _G.autofarm do wait(0.3)
  44.     fireclickdetector(getclosestbox().ClickDetector)
  45. end
  46.  
  47. while _G.autocollect do wait()
  48.     autocollect()
  49. end