---
title: "AutoFarm Universal | Universal Roblox Script - ScriptBlox"
description: "AutoFarm Universal for any Roblox game: This GUI is keyless, Type the name of the item and press AutoFarm Toggle to start farmin!"
canonical_url: "https://scriptblox.com/script/Universal-Script-AutoFarm-Universal-29334"
meta:
  "og:description": "AutoFarm Universal for any Roblox game: This GUI is keyless, Type the name of the item and press AutoFarm Toggle to start farmin!"
  "og:image": "https://scriptblox.com/images/script/6195467-1739653935353.png"
  "og:title": "AutoFarm Universal | Universal Roblox Script - ScriptBlox"
  "twitter:description": "AutoFarm Universal for any Roblox game: This GUI is keyless, Type the name of the item and press AutoFarm Toggle to start farmin!"
  "twitter:image": "https://scriptblox.com/images/script/6195467-1739653935353.png"
  "twitter:title": "AutoFarm Universal | Universal Roblox Script - ScriptBlox"
---

> Index of every page on this site: [llms.txt](https://scriptblox.com/llms.txt)

![Universal Script 📌](https://scriptblox.com/images/script/6195467-1739653935353.png)

# **AutoFarm Universal**

[**Universal Script 📌**](https://scriptblox.com/game/universal)**![mpopeesayshi](https://scriptblox.com/images/user-default.webp) [mpopeesayshi](https://scriptblox.com/u/mpopeesayshi)First script**

2 years ago

[**Get an executor**](https://scriptblox.com/executors?kind=executor)

Please login to perform these actions:

## **Does it work? **

**No reports yet **

No reports yet. Tried it? Be the first to say.

Also noticed:

## Description

This GUI is keyless, Type the name of the item and press AutoFarm Toggle to start farmin!

## **Updates **

1. Mar 27, 2025

   ****Script edited:**** Create script

[View Raw](https://scriptblox.com/raw/Universal-Script-AutoFarm-Universal-29334)

```
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
local runService = game:GetService("RunService")

local autoFarm = false
local targetName = ""

-- Create GUI
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = player.PlayerGui

local frame = Instance.new("Frame")
frame.Size = UDim2.new(0, 300, 0, 150)
frame.Position = UDim2.new(0.5, -150, 0.2, 0)
frame.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
frame.Parent = screenGui

local toggleButton = Instance.new("TextButton")
toggleButton.Size = UDim2.new(0, 280, 0, 50)
toggleButton.Position = UDim2.new(0, 10, 0, 10)
toggleButton.Text = "Start Auto Farm"
toggleButton.BackgroundColor3 = Color3.new(0, 1, 0)
toggleButton.Parent = frame

local inputBox = Instance.new("TextBox")
inputBox.Size = UDim2.new(0, 280, 0, 50)
inputBox.Position = UDim2.new(0, 10, 0, 70)
inputBox.PlaceholderText = "Enter Object Name"
inputBox.Parent = frame

-- Function to find the nearest object by name
local function findClosestObject()
    local closest = nil
    local shortestDistance = math.huge
    for _, obj in pairs(workspace:GetChildren()) do
        if obj:IsA("Part") and string.find(obj.Name:lower(), targetName:lower()) then
            local distance = (humanoidRootPart.Position - obj.Position).Magnitude
            if distance < shortestDistance then
                shortestDistance = distance


```

## **Comments **

**1**

Log in to join the conversation. [**Login **](https://scriptblox.com/login?redirect=/script/Universal-Script-AutoFarm-Universal-29334)

![jjhonson9220's profile picture](https://scriptblox.com/images/user-default.webp)

[**jjhonson9220**](https://scriptblox.com/u/jjhonson9220)2 years ago(edited)

do it work with jji?

1

```json
{"@context":"https://schema.org","@type":"SoftwareSourceCode","@id":"https://scriptblox.com/script/Universal-Script-AutoFarm-Universal-29334#script","url":"https://scriptblox.com/script/Universal-Script-AutoFarm-Universal-29334","name":"AutoFarm Universal","programmingLanguage":"Lua","runtimePlatform":"Roblox","author":{"@type":"Person","name":"mpopeesayshi","url":"https://scriptblox.com/u/mpopeesayshi"},"datePublished":"2025-02-15T21:12:15.397Z","image":"https://scriptblox.com/images/script/6195467-1739653935353.png","isAccessibleForFree":true}
```

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://scriptblox.com/#website","@type":"WebSite","description":"Search free Roblox scripts uploaded by the community, with live status for every major executor. Browse by game, copy the loadstring and run it in your executor.","inLanguage":"en","name":"ScriptBlox","url":"https://scriptblox.com/"},{"@id":"https://scriptblox.com/script/Universal-Script-AutoFarm-Universal-29334#webpage","@type":"WebPage","description":"AutoFarm Universal for any Roblox game: This GUI is keyless, Type the name of the item and press AutoFarm Toggle to start farmin!","name":"AutoFarm Universal | Universal Roblox Script - ScriptBlox","url":"https://scriptblox.com/script/Universal-Script-AutoFarm-Universal-29334","breadcrumb":{"@id":"https://scriptblox.com/script/Universal-Script-AutoFarm-Universal-29334#breadcrumb"},"isPartOf":{"@id":"https://scriptblox.com/#website"},"mainEntity":{"@id":"https://scriptblox.com/script/Universal-Script-AutoFarm-Universal-29334#script"},"potentialAction":[{"@type":"ReadAction","target":["https://scriptblox.com/script/Universal-Script-AutoFarm-Universal-29334"]}]},{"@id":"https://scriptblox.com/script/Universal-Script-AutoFarm-Universal-29334#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://scriptblox.com","position":1},{"@type":"ListItem","name":"Universal","item":"https://scriptblox.com/game/universal","position":2},{"@type":"ListItem","name":"AutoFarm Universal","position":3}]}]}
```

## Sitemap

See the full [sitemap](https://scriptblox.com/sitemap.md) for all pages.
