AUTO FARM TBB
Key RequiredUniversal

AUTO FARM TBB

Universal Scriptjgbrtlf2012jgbrtlf2012 439 views 1.4K executesUpdated Jul 24, 2026
Unrated
00
Lua Script•230 lines (7039 chars)
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TeleportService = game:GetService("TeleportService")

local player = Players.LocalPlayer
local Events = ReplicatedStorage.Events
local RemoteEvents = Events.RemoteEvents
local RemoteFunction = Events.RemoteFunction

local StartBattle = RemoteFunction.StartBattle
local PlayerSpawn = RemoteFunction.PlayerSpawn
local SaveLoadout = RemoteEvents.SaveLoadout
local GiveUp = RemoteEvents.GiveUp
local WinOrLose = RemoteEvents.WinOrLose

local GameValues = require(ReplicatedStorage.Modules.GameValues)
local SPEED_BATTLER_ID = 10

local enabled = false
local inRound = false
local roundCount = 0
local FARM_CHAPTER = "Chapter1"
local FARM_STAGE = 10
local FARM_DIFF = 2
local REJOIN_EVERY = 4
local PLACE_ID = 10834586502

local function setLoadout()
    local pd = player:FindFirstChild("PlayerData")
    if not pd then return false end
    local loadout = pd:FindFirstChild("Loadout")
    if not loadout then return false end
    local slot = loadout:FindFirstChild("1")
    if not slot then return false end

    local slots = slot:FindFirstChild("Slots")
    local types = slot:FindFirstChild("Type")
    if not slots or not types then return false end

    for i = 1, 8 do
        local s = slots:FindFirstChild("Slot" .. i)
        local t = types:FindFirstChild("Slot" .. i)
        if s then s.Value = SPEED_BATTLER_ID end
        if t then t.Value = "A" end
    end

    SaveLoadout:FireServer("1")
    return true
end

local function startBattle(chapter, stage, diff)
    GameValues.Chapter = chapter
    GameValues.Stage = stage
    GameValues.Difficulty = diff
    GameValues.Stars = 1
    GameValues.LevelLimit = {Unit = nil, Base = nil}
    GameValues.EnableDoubleXP = false
    GameValues.EnemyMultiplier = 1
    return StartBattle:InvokeServer(chapter, stage, diff, 1, false, {Unit = nil, Base = nil}, false, 1)
end

local function waitForLobby()
    for _ = 1, 60 do
        local mm = player.PlayerGui:FindFirstChild("MainMenu")
        if mm then
            for _, v in mm:GetChildren() do
                if v:IsA("Frame") and v.Visible and (v.Name == "StageSelect" or v.Name == "Lobby") then
                    return true
                end
            end
        end
        task.wait(0.5)
    end
    return false
end

local function doFarm()
    setLoadout()

    while enabled do
        roundCount = roundCount + 1

        if roundCount > REJOIN_EVERY then
            TeleportService:Teleport(PLACE_ID, player)
            return
        end

        task.wait(2)
        local ok = startBattle(FARM_CHAPTER, FARM_STAGE, FARM_DIFF)
        if not ok then
            task.wait(2)
            continue
        end

        inRound = true
        while enabled and inRound do
            pcall(function() PlayerSpawn:InvokeServer("Slot1") end)
            task.wait(0.3)
        end

        waitForLobby()
    end
end

WinOrLose.OnClientEvent:Connect(function(won)
    inRound = false
end)

local container = player:WaitForChild("PlayerGui")
local old = container:FindFirstChild("PaintballFarmGUI")
if old then old:Destroy() end

local gui = Instance.new("ScreenGui")
gui.Name = "PaintballFarmGUI"
gui.ResetOnSpawn = false
gui.Parent = container

local main = Instance.new("Frame")
main.Size = UDim2.new(0, 0, 0, 0)
main.Position = UDim2.new(0.5, 0, 0.5, 0)
main.AnchorPoint = Vector2.new(0.5, 0.5)
main.BackgroundColor3 = Color3.fromRGB(8, 8, 16)
main.BorderSizePixel = 0
main.Active = true
main.Draggable = true
main.ClipsDescendants = true
main.Parent = gui
Instance.new("UICorner", main).CornerRadius = UDim.new(0, 10)
local stroke = Instance.new("UIStroke")
stroke.Color = Color3.fromRGB(255, 90, 90)
stroke.Thickness = 1
stroke.Parent = main

local header = Instance.new("Frame")
header.Size = UDim2.new(1, 0, 0, 38)
header.BackgroundColor3 = Color3.fromRGB(14, 14, 24)
header.BorderSizePixel = 0
header.Parent = main
Instance.new("UICorner", header).CornerRadius = UDim.new(0, 10)
local hf = Instance.new("Frame")
hf.Size = UDim2.new(1, 0, 0, 10)
hf.Position = UDim2.new(0, 0, 1, -10)
hf.BackgroundColor3 = Color3.fromRGB(14, 14, 24)
hf.BorderSizePixel = 0
hf.Parent = header

local title = Instance.new("TextLabel")
title.Size = UDim2.new(0.6, 0, 1, 0)
title.Position = UDim2.new(0, 12, 0, 0)
title.BackgroundTransparency = 1
title.Text = "Ultimate Paintball Farm"
title.TextColor3 = Color3.new(1, 1, 1)
title.TextXAlignment = Enum.TextXAlignment.Left
title.TextScaled = true
title.Font = Enum.Font.GothamBold
title.Parent = header

local closeBtn = Instance.new("TextButton")
closeBtn.Size = UDim2.new(0, 24, 0, 24)
closeBtn.Position = UDim2.new(1, -30, 0.5, -12)
closeBtn.BackgroundColor3 = Color3.fromRGB(240, 70, 70)
closeBtn.BorderSizePixel = 0
closeBtn.Text = "x"
closeBtn.TextColor3 = Color3.new(1, 1, 1)
closeBtn.TextScaled = true
closeBtn.Font = Enum.Font.GothamBold
closeBtn.Parent = header
Instance.new("UICorner", closeBtn).CornerRadius = UDim.new(0, 5)
closeBtn.MouseButton1Click:Connect(function() gui:Destroy() end)

local statusLabel = Instance.new("TextLabel")
statusLabel.Size = UDim2.new(1, -20, 0, 20)
statusLabel.Position = UDim2.new(0, 10, 0, 48)
statusLabel.BackgroundTransparency = 1
statusLabel.Text = "Status: Idle"
statusLabel.TextColor3 = Color3.fromRGB(130, 130, 155)
statusLabel.TextXAlignment = Enum.TextXAlignment.Left
statusLabel.TextScaled = true
statusLabel.Font = Enum.Font.Gotham
statusLabel.Parent = main

local startBtn = Instance.new("TextButton")
startBtn.Size = UDim2.new(1, -20, 0, 36)
startBtn.Position = UDim2.new(0, 10, 0, 78)
startBtn.BackgroundColor3 = Color3.fromRGB(60, 210, 120)
startBtn.BorderSizePixel = 0
startBtn.Text = "Start"
startBtn.TextColor3 = Color3.new(1, 1, 1)
startBtn.TextScaled = true
startBtn.Font = Enum.Font.GothamBold
startBtn.Parent = main
Instance.new("UICorner", startBtn).CornerRadius = UDim.new(0, 8)

startBtn.MouseButton1Click:Connect(function()
    enabled = not enabled
    if enabled then
        startBtn.Text = "Stop"
        startBtn.BackgroundColor3 = Color3.fromRGB(240, 70, 70)
        statusLabel.Text = "Farming..."
        task.spawn(doFarm)
    else
        startBtn.Text = "Start"
        startBtn.BackgroundColor3 = Color3.fromRGB(60, 210, 120)
        statusLabel.Text = "Stopped"
    end
end)

UserInputService.InputBegan:Connect(function(inp, gpe)
    if gpe then return end
    if inp.KeyCode == Enum.KeyCode.Insert then
        main.Visible = not main.Visible
    end
end)

TweenService:Create(main, TweenInfo.new(0.3, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {
    Size = UDim2.new(0, 260, 0, 130)
}):Play()

task.spawn(function()
    task.wait(30)
    if not enabled then
        enabled = true
        startBtn.Text = "Stop"
        startBtn.BackgroundColor3 = Color3.fromRGB(240, 70, 70)
        statusLabel.Text = "Farming..."
        task.spawn(doFarm)
    end
end)

Features & Information

Credits to ZAYNNN AUTO FARM STAGE 10 PUT THE SPEED BATLER FIRST SLOT
#Credits to Zaynnn

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts