MrChristy

Be A Bird Auto Farm

Jul 30th, 2025
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | Gaming | 0 0
  1. -- SETTINGS --
  2. local collectibleNames = {"Pear", "Banana", "Seed"}
  3. local autoCollect = false
  4.  
  5. -- SERVICES --
  6. local Players = game:GetService("Players")
  7. local player = Players.LocalPlayer
  8. local character = player.Character or player.CharacterAdded:Wait()
  9. local root = character:WaitForChild("HumanoidRootPart")
  10. local Workspace = game:GetService("Workspace")
  11.  
  12. -- GUI SETUP --
  13. local ScreenGui = Instance.new("ScreenGui", game.CoreGui)
  14. ScreenGui.Name = "EdibleCollectorGUI"
  15.  
  16. local button = Instance.new("TextButton", ScreenGui)
  17. button.Size = UDim2.new(0, 180, 0, 40)
  18. button.Position = UDim2.new(0, 10, 0, 10)
  19. button.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
  20. button.Text = "Auto Collect: OFF"
  21. button.TextSize = 18
  22. button.TextColor3 = Color3.new(1, 1, 1)
  23. button.BorderSizePixel = 0
  24. button.Active = true
  25. button.Draggable = true
  26.  
  27. -- FUNCTION: Is collectible?
  28. local function isCollectible(item)
  29. for _, keyword in pairs(collectibleNames) do
  30. if string.lower(item.Name):find(string.lower(keyword)) then
  31. return true
  32. end
  33. end
  34. return false
  35. end
  36.  
  37. -- FUNCTION: Teleport item to player
  38. local function collect(item)
  39. pcall(function()
  40. item.CFrame = root.CFrame + Vector3.new(0, 3, 0)
  41. end)
  42. end
  43.  
  44. -- LOOP: Scan every 0.5 sec
  45. task.spawn(function()
  46. while true do
  47. if autoCollect then
  48. for _, obj in pairs(Workspace:GetDescendants()) do
  49. if obj:IsA("BasePart") and isCollectible(obj) then
  50. collect(obj)
  51. end
  52. end
  53. end
  54. task.wait(0.5)
  55. end
  56. end)
  57.  
  58. -- NEW ITEM DETECTION
  59. Workspace.DescendantAdded:Connect(function(obj)
  60. if obj:IsA("BasePart") and isCollectible(obj) then
  61. repeat task.wait() until autoCollect and root -- wait until ready
  62. collect(obj)
  63. end
  64. end)
  65.  
  66. -- BUTTON TOGGLE
  67. button.MouseButton1Click:Connect(function()
  68. autoCollect = not autoCollect
  69. button.Text = "Auto Collect: " .. (autoCollect and "ON" or "OFF")
  70. button.BackgroundColor3 = autoCollect and Color3.fromRGB(0, 200, 0) or Color3.fromRGB(0, 170, 255)
  71. end)
Advertisement
Add Comment
Please, Sign In to add comment