Autofarm
Key Required

Autofarm

Tower BattlesRedLineWinRedLineWin 3.9K views 461 executesUpdated Dec 28, 2025
2.5/ 5(2 votes)
1150% Positive
Lua Script•81 lines (2043 chars)
repeat wait() until game:IsLoaded()

getgenv().LengthThreshold = 150 -- Use this to set maximum map length.
getgenv().SurvivalPlaceId = 49707852
getgenv().LobbyPlaceId = 45146873
getgenv().VetoDelay = 0.5

local TeleportService = game:GetService("TeleportService")

local function getMapLength(mapName)
 local mapsInfo = workspace:FindFirstChild("MapsInformation")
 if not mapsInfo then return math.huge end

 local mapData = mapsInfo:FindFirstChild(mapName)
 if not mapData then return math.huge end

 local lengthValue = mapData:FindFirstChild("Length")
 if not lengthValue then return math.huge end

 return lengthValue.Value
end

local function findShortestMap()
 local mapSlots = {"Map1", "Map2", "Map3"}
 local bestSlot = nil
 local bestLength = math.huge

 for _, slot in ipairs(mapSlots) do
 local mapObj = workspace:FindFirstChild(slot)
 if not mapObj then continue end

 local typeValue = mapObj:FindFirstChild("Type")
 if not typeValue then continue end

 local mapName = typeValue.Value
 if not mapName or mapName == "" then continue end

 local length = getMapLength(mapName)

 if length < bestLength then
 bestLength = length
 bestSlot = slot
 end
 end

 return bestSlot, bestLength
end

if game.PlaceId == getgenv().LobbyPlaceId then
 -- Collect rewards and teleport to survival
 wait(1)
 workspace:WaitForChild("SurvivalAnalysis"):InvokeServer()
 wait(1)
 TeleportService:Teleport(getgenv().SurvivalPlaceId)

elseif game.PlaceId == getgenv().SurvivalPlaceId then
 -- Find shortest map and start game
 local Vote = workspace:WaitForChild("Vote")
 wait(2)

 local attempts = 0
 while attempts < 50 do
 attempts = attempts + 1
 local bestSlot, bestLength = findShortestMap()

 if bestSlot and bestLength <= getgenv().LengthThreshold then
 Vote:InvokeServer(bestSlot)
 break
 else
 Vote:InvokeServer("Veto")
 wait(getgenv().VetoDelay)
 end
 end

 -- Skip the 60 second wait
 workspace:WaitForChild("SkipWaitVote"):InvokeServer()

else
 -- Unknown place, teleport to survival
 TeleportService:Teleport(getgenv().SurvivalPlaceId)
end

Features & Information

A simple autofarm for Planet3arth's Tower Battles. Teleports you into a survival lobby, picks a short map and vetoes if it can't find one short enough, (can change desired maximum map length by editing value), skips the wait, then waits to die. You collect 20 credits for each death upon re-entering the lobby. Rinse and repeat. Make sure your executor has an autoexecute folder to place the script in, and that auto-attach is turned on.
#Autofarm#Tower Battles

Community Comments (5)

highheavenpalace3highheavenpalace3Dec 28, 2025

this game still alive? hm

thanos_53thanos_53Jan 11, 2026

works flawlessly even with low unc executors like xeno. needed this

thanos_53thanos_53Jan 11, 2026

also hope soon you can make 1 that farms wins too

terrifficnymphterrifficnymphMay 28, 2026

while trying to use this script, i get error 773. teleportation error

script__script__Jun 7, 2026

Don't make anymore scripts for TB, the game is nearly dead and it'd be sad to see such a iconic game dry out further.

More Scripts for Tower Battles