local CYBERTECH_SAFEZONE_POS = Vector3.new(-345.71, 180.80, -3461.89)
local CYBERTECH_SAFEZONE_RADIUS = 50 -- adjust if needed
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local oldGui = playerGui:FindFirstChild("LootControllerGui")
if oldGui then oldGui:Destroy() end
local CURRENT_PLOT = nil
local CURRENT_ISLAND = nil
local TELEPORT_DELAY = 0.08
local AUTO_FARMING = false
local AUTO_LOOP_RUNNING = false
local SPLIT_WAIT_TIME = 10
local MAX_SPLIT_RETRIES = 3
local ISLANDS = {"Basic", "VoidReef", "CyberTech", "RainbowReef", "RadioactiveReef"}
local PLOTS = {"Plot1", "Plot2", "Plot3", "Plot4", "Plot5"}
local BINDS = {
Collect = Enum.KeyCode.G,
Home = Enum.KeyCode.F,
Split = Enum.KeyCode.H,
AutoFarm = Enum.KeyCode.J,
SellAll = Enum.KeyCode.K,
}
local BIND_NAMES = {"Collect", "Home", "Split", "AutoFarm", "SellAll"}
local lootFolder = workspace:WaitForChild("ActiveLoot")
local busy = false
local bindListening = nil
local function freezeCharacter()
local ch = player.Character
if not ch then return end
local hrp = ch:FindFirstChild("HumanoidRootPart")
local hum = ch:FindFirstChild("Humanoid")
if hrp then
hrp.Velocity = Vector3.new(0, 0, 0)
hrp.AssemblyLinearVelocity = Vector3.new(0, 0, 0)
hrp.AssemblyAngularVelocity = Vector3.new(0, 0, 0)
end
if hum then
hum:ChangeState(Enum.HumanoidStateType.Running)
end
end
local function safeTp(cf)
local ch = player.Character
if not ch then return false end
local hrp = ch:FindFirstChild("HumanoidRootPart")
if not hrp then return false end
hrp.Velocity = Vector3.new(0, 0, 0)
hrp.AssemblyLinearVelocity = Vector3.new(0, 0, 0)
hrp.AssemblyAngularVelocity = Vector3.new(0, 0, 0)
hrp.CFrame = cf
task.wait()
hrp.Velocity = Vector3.new(0, 0, 0)
hrp.AssemblyLinearVelocity = Vector3.new(0, 0, 0)
hrp.AssemblyAngularVelocity = Vector3.new(0, 0, 0)
local hum = ch:FindFirstChild("Humanoid")
if hum then hum:ChangeState(Enum.HumanoidStateType.Running) end
return true
end
local function waitChar()
local c = player.Character or player.CharacterAdded:Wait()
c:WaitForChild("HumanoidRootPart")
c:WaitForChild("Humanoid")
return c
end
local function hasHeldItem()
local ch = player.Character
if not ch then return false end
if ch:FindFirstChild("HeldItem") then return true end
local bs = ch:FindFirstChild("BackStick")
if bs then
local cube = bs:FindFirstChild("Cube.004")
if cube and cube:IsA("BasePart") and cube.Transparency >= 0.99 then
return true
end
end
return false
end
local function detectPlayerPlot()
local islands = workspace:FindFirstChild("Islands")
if not islands then return end
for _, islandName in ipairs(ISLANDS) do
local island = islands:FindFirstChild(islandName)
if not island then continue end
local plots = island:FindFirstChild("Plots")
if not plots then continue end
for _, plot in ipairs(plots:GetChildren()) do
local ownerId = plot:GetAttribute("OwnerUserId")
if ownerId and ownerId == player.UserId then
CURRENT_ISLAND = islandName
CURRENT_PLOT = plot.Name
return
end
end
end
if not CURRENT_ISLAND then CURRENT_ISLAND = "Basic" end
if not CURRENT_PLOT then CURRENT_PLOT = "Plot1" end
end
detectPlayerPlot()
task.spawn(function()
while true do
task.wait(5)
detectPlayerPlot()
pcall(function()
if islandDropdown then islandDropdown.Text = CURRENT_ISLAND end
if plotDropdown then plotDropdown.Text = CURRENT_PLOT end
if statusLabel then statusLabel.Text = "🌍 " .. tostring(CURRENT_ISLAND) .. " / " .. tostring(CURRENT_PLOT) end
end)
end
end)
--// GUI
local screenGui = Instance.new("ScreenGui", playerGui)
screenGui.Name = "LootControllerGui"
screenGui.ResetOnSpawn = false
local miniButton = Instance.new("TextButton", screenGui)
miniButton.Size = UDim2.new(0, 36, 0, 36)
miniButton.Position = UDim2.new(0.1, 0, 0.15, 0)
miniButton.BackgroundColor3 = Color3.fromRGB(0, 150, 255)
miniButton.Text = "⚡"
miniButton.TextColor3 = Color3.new(1, 1, 1)
miniButton.Font = Enum.Font.GothamBold
miniButton.TextSize = 16
miniButton.Visible = false
miniButton.Active = true
miniButton.Draggable = true
Instance.new("UICorner", miniButton).CornerRadius = UDim.new(0, 8)
local frame = Instance.new("Frame", screenGui)
frame.Name = "MainFrame"
frame.Size = UDim2.new(0, 245, 0, 405)
frame.Position = UDim2.new(0.1, 0, 0.1, 0)
frame.BackgroundColor3 = Color3.fromRGB(18, 18, 28)
frame.Active = true
frame.Draggable = true
frame.BorderSizePixel = 0
Instance.new("UICorner", frame).CornerRadius = UDim.new(0, 8)
local fStroke = Instance.new("UIStroke", frame)
fStroke.Color = Color3.fromRGB(0, 130, 255)
fStroke.Thickness = 1.5
local titleBar = Instance.new("Frame", frame)
titleBar.Size = UDim2.new(1, 0, 0, 26)
titleBar.BackgroundColor3 = Color3.fromRGB(0, 100, 180)
titleBar.BorderSizePixel = 0
Instance.new("UICorner", titleBar).CornerRadius = UDim.new(0, 8)
local title = Instance.new("TextLabel", titleBar)
title.Size = UDim2.new(1, -30, 1, 0)
title.Position = UDim2.new(0, 6, 0, 0)
title.Text = "⚡ Loot Ctrl"
title.BackgroundTransparency = 1
title.TextColor3 = Color3.new(1, 1, 1)
title.Font = Enum.Font.GothamBold
title.TextSize = 11
title.TextXAlignment = Enum.TextXAlignment.Left
local minimizeBtn = Instance.new("TextButton", titleBar)
minimizeBtn.Size = UDim2.new(0, 20, 0, 20)
minimizeBtn.Position = UDim2.new(1, -23, 0, 3)
minimizeBtn.Text = "−"
minimizeBtn.TextColor3 = Color3.new(1, 1, 1)
minimizeBtn.BackgroundColor3 = Color3.fromRGB(180, 40, 40)
minimizeBtn.Font = Enum.Font.GothamBold
minimizeBtn.TextSize = 14
minimizeBtn.BorderSizePixel = 0
Instance.new("UICorner", minimizeBtn).CornerRadius = UDim.new(0, 5)
statusLabel = Instance.new("TextLabel", frame)
statusLabel.Size = UDim2.new(1, -14, 0, 14)
statusLabel.Position = UDim2.new(0, 7, 0, 28)
statusLabel.Text = "🌍 " .. tostring(CURRENT_ISLAND) .. " / " .. tostring(CURRENT_PLOT)
statusLabel.BackgroundTransparency = 1
statusLabel.TextColor3 = Color3.fromRGB(0, 255, 120)
statusLabel.Font = Enum.Font.GothamBold
statusLabel.TextSize = 10
statusLabel.TextXAlignment = Enum.TextXAlignment.Left
local function updateStatus()
statusLabel.Text = "🌍 " .. tostring(CURRENT_ISLAND) .. " / " .. tostring(CURRENT_PLOT)
end
local function createDropdown(parent, position, options, default, callback)
local container = Instance.new("Frame", parent)
container.Position = position
container.Size = UDim2.new(0, 225, 0, 20)
container.BackgroundColor3 = Color3.fromRGB(38, 38, 52)
container.ZIndex = 2
container.BorderSizePixel = 0
Instance.new("UICorner", container).CornerRadius = UDim.new(0, 5)
local button = Instance.new("TextButton", container)
button.Size = UDim2.new(1, 0, 1, 0)
button.Text = default or options[1]
button.TextColor3 = Color3.new(1, 1, 1)
button.BackgroundTransparency = 1
button.ZIndex = 3
button.Font = Enum.Font.Gotham
button.TextSize = 10
local listFrame = Instance.new("ScrollingFrame", container)
listFrame.Position = UDim2.new(0, 0, 1, 2)
listFrame.Size = UDim2.new(1, 0, 0, math.min(#options * 20, 100))
listFrame.CanvasSize = UDim2.new(0, 0, 0, #options * 20)
listFrame.BackgroundColor3 = Color3.fromRGB(28, 28, 42)
listFrame.Visible = false
listFrame.ZIndex = 10
listFrame.BorderSizePixel = 0
listFrame.ScrollBarThickness = 3
Instance.new("UICorner", listFrame).CornerRadius = UDim.new(0, 5)
for i, option in ipairs(options) do
local opt = Instance.new("TextButton", listFrame)
opt.Size = UDim2.new(1, 0, 0, 20)
opt.Position = UDim2.new(0, 0, 0, (i - 1) * 20)
opt.Text = option
opt.BackgroundTransparency = 0.6
opt.BackgroundColor3 = Color3.fromRGB(50, 50, 65)
opt.TextColor3 = Color3.new(1, 1, 1)
opt.ZIndex = 11
opt.Font = Enum.Font.Gotham
opt.TextSize = 10
opt.BorderSizePixel = 0
opt.MouseButton1Click:Connect(function()
button.Text = option
listFrame.Visible = false
callback(option)
end)
end
button.MouseButton1Click:Connect(function()
listFrame.Visible = not listFrame.Visible
end)
return button
end
islandDropdown = createDropdown(frame, UDim2.new(0, 8, 0, 44), ISLANDS, CURRENT_ISLAND, function(v) CURRENT_ISLAND = v updateStatus() end)
plotDropdown = createDropdown(frame, UDim2.new(0, 8, 0, 68), PLOTS, CURRENT_PLOT, function(v) CURRENT_PLOT = v updateStatus() end)
local function makeBtn(parent, pos, size, text, color)
local btn = Instance.new("TextButton", parent)
btn.Position = pos
btn.Size = size
btn.Text = text
btn.TextColor3 = Color3.new(1, 1, 1)
btn.BackgroundColor3 = color
btn.Font = Enum.Font.GothamBold
btn.TextSize = 10
btn.BorderSizePixel = 0
Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 5)
return btn
end
local delayL = Instance.new("TextLabel", frame)
delayL.Position = UDim2.new(0, 8, 0, 92)
delayL.Size = UDim2.new(0, 35, 0, 18)
delayL.Text = "Delay"
delayL.BackgroundTransparency = 1
delayL.TextColor3 = Color3.fromRGB(180, 180, 200)
delayL.Font = Enum.Font.Gotham
delayL.TextSize = 9
delayL.TextXAlignment = Enum.TextXAlignment.Left
local delayBox = Instance.new("TextBox", frame)
delayBox.Position = UDim2.new(0, 45, 0, 92)
delayBox.Size = UDim2.new(0, 188, 0, 18)
delayBox.Text = tostring(TELEPORT_DELAY)
delayBox.TextColor3 = Color3.new(1, 1, 1)
delayBox.BackgroundColor3 = Color3.fromRGB(38, 38, 52)
delayBox.Font = Enum.Font.Gotham
delayBox.TextSize = 10
delayBox.BorderSizePixel = 0
Instance.new("UICorner", delayBox).CornerRadius = UDim.new(0, 5)
delayBox.FocusLost:Connect(function()
local v = tonumber(delayBox.Text)
if v then TELEPORT_DELAY = v end
end)
local function sep(y)
local s = Instance.new("Frame", frame)
s.Position = UDim2.new(0, 8, 0, y)
s.Size = UDim2.new(0, 225, 0, 1)
s.BackgroundColor3 = Color3.fromRGB(45, 45, 60)
s.BorderSizePixel = 0
end
sep(114)
local collectBtn = makeBtn(frame, UDim2.new(0, 8, 0, 118), UDim2.new(0, 110, 0, 26), "🧲 Collect", Color3.fromRGB(0, 120, 60))
local homeBtn = makeBtn(frame, UDim2.new(0, 123, 0, 118), UDim2.new(0, 110, 0, 26), "🏠 Home", Color3.fromRGB(0, 75, 165))
local sellBtn = makeBtn(frame, UDim2.new(0, 8, 0, 148), UDim2.new(0, 110, 0, 26), "💰 Sell All", Color3.fromRGB(170, 120, 0))
local splitBtn = makeBtn(frame, UDim2.new(0, 123, 0, 148), UDim2.new(0, 110, 0, 26), "🪓 Split", Color3.fromRGB(150, 40, 40))
sep(178)
local autoFarmBtn = makeBtn(frame, UDim2.new(0, 8, 0, 182), UDim2.new(0, 225, 0, 28), "🔄 AUTO FARM: OFF", Color3.fromRGB(80, 20, 20))
sep(214)
local bindsT = Instance.new("TextLabel", frame)
bindsT.Position = UDim2.new(0, 8, 0, 217)
bindsT.Size = UDim2.new(0, 225, 0, 12)
bindsT.Text = "⌨️ BINDS (click to rebind)"
bindsT.BackgroundTransparency = 1
bindsT.TextColor3 = Color3.fromRGB(180, 180, 220)
bindsT.Font = Enum.Font.GothamBold
bindsT.TextSize = 9
bindsT.TextXAlignment = Enum.TextXAlignment.Left
local bindButtons = {}
local function getKeyName(kc) return kc and kc.Name or "?" end
local function updateBindTexts()
for _, n in ipairs(BIND_NAMES) do
if bindButtons[n] then
bindButtons[n].Text = n .. " [" .. getKeyName(BINDS[n]) .. "]"
end
end
collectBtn.Text = "🧲 Collect [" .. getKeyName(BINDS.Collect) .. "]"
homeBtn.Text = "🏠 Home [" .. getKeyName(BINDS.Home) .. "]"
splitBtn.Text = "🪓 Split [" .. getKeyName(BINDS.Split) .. "]"
sellBtn.Text = "💰 Sell [" .. getKeyName(BINDS.SellAll) .. "]"
autoFarmBtn.Text = AUTO_FARMING
and ("🔄 AUTO: ON [" .. getKeyName(BINDS.AutoFarm) .. "]")
or ("🔄 AUTO: OFF [" .. getKeyName(BINDS.AutoFarm) .. "]")
end
for i, name in ipairs(BIND_NAMES) do
local col = (i - 1) % 2
local row = math.floor((i - 1) / 2)
local btn = makeBtn(frame, UDim2.new(0, 8 + col * 116, 0, 232 + row * 24), UDim2.new(0, 110, 0, 20), name .. " [" .. getKeyName(BINDS[name]) .. "]", Color3.fromRGB(48, 48, 65))
btn.TextSize = 9
btn.Font = Enum.Font.Gotham
bindButtons[name] = btn
btn.MouseButton1Click:Connect(function()
if bindListening then return end
bindListening = name
btn.Text = name .. " [...]"
btn.BackgroundColor3 = Color3.fromRGB(200, 90, 0)
end)
end
local logLabel = Instance.new("TextLabel", frame)
logLabel.Position = UDim2.new(0, 8, 0, 310)
logLabel.Size = UDim2.new(1, -16, 0, 85)
logLabel.Text = "Ready."
logLabel.BackgroundTransparency = 1
logLabel.TextColor3 = Color3.fromRGB(160, 160, 180)
logLabel.Font = Enum.Font.Gotham
logLabel.TextSize = 9
logLabel.TextWrapped = true
logLabel.TextYAlignment = Enum.TextYAlignment.Top
logLabel.TextXAlignment = Enum.TextXAlignment.Left
local function setLog(msg) logLabel.Text = "📋 " .. msg end
minimizeBtn.MouseButton1Click:Connect(function()
frame.Visible = false
miniButton.Visible = true
miniButton.Position = frame.Position
end)
miniButton.MouseButton1Click:Connect(function()
miniButton.Visible = false
frame.Position = miniButton.Position
frame.Visible = true
end)
--// ЗОНЫ
local function getSafeZone()
-- Special manual SafeZone for CyberTech
if CURRENT_ISLAND == "CyberTech" then
return {
Position = CYBERTECH_SAFEZONE_POS,
Size = Vector3.new(CYBERTECH_SAFEZONE_RADIUS, CYBERTECH_SAFEZONE_RADIUS, CYBERTECH_SAFEZONE_RADIUS)
}
end
-- Default system for other islands
local isl = workspace:FindFirstChild("Islands")
if not isl then return nil end
isl = isl:FindFirstChild(CURRENT_ISLAND)
if not isl then return nil end
local p = isl:FindFirstChild("Plots")
if not p then return nil end
p = p:FindFirstChild(CURRENT_PLOT)
if not p then return nil end
local imp = p:FindFirstChild("Important")
if not imp then return nil end
return imp:FindFirstChild("SafeZone")
end
local function getSplitZone()
local isl = workspace:FindFirstChild("Islands")
if not isl then return nil end
isl = isl:FindFirstChild(CURRENT_ISLAND)
if not isl then return nil end
local p = isl:FindFirstChild("Plots")
if not p then return nil end
p = p:FindFirstChild(CURRENT_PLOT)
if not p then return nil end
local imp = p:FindFirstChild("Important")
if not imp then return nil end
return imp:FindFirstChild("SplitZone")
end
--// СБОР ЛУТА — ТОЛЬКО СВОЙ ПЛОТ + В РАДИУСЕ 800
local function getMatchingLoot()
local matches = {}
local ch = player.Character
if not ch then return matches end
local hrp = ch:FindFirstChild("HumanoidRootPart")
if not hrp then return matches end
for _, m in ipairs(lootFolder:GetChildren()) do
if m:IsA("Model") and m:GetAttribute("PlotName") == CURRENT_PLOT then
local ok, pv = pcall(function() return m:GetPivot() end)
if ok then
local dist = (pv.Position - hrp.Position).Magnitude
if dist <= 800 then
table.insert(matches, m)
end
end
end
end
return matches
end
--// HOME = SafeZone (сдача ресурсов), невысоко
local function doHome()
local sz = getSafeZone()
if not sz then
setLog("SafeZone not found!")
return false
end
waitChar()
local targetPosition
if typeof(sz) == "table" then
targetPosition = sz.Position + Vector3.new(0, 3, 0)
else
targetPosition = Vector3.new(
sz.Position.X,
sz.Position.Y + sz.Size.Y / 2 + 1,
sz.Position.Z
)
end
local targetCF = CFrame.new(targetPosition)
safeTp(targetCF)
task.wait(0.1)
freezeCharacter()
setLog("Home (SafeZone).")
return true
end
--// COLLECT — свой плот, радиус 800
local function doCollect()
if busy then return false end
busy = true
setLog("Collecting...")
waitChar()
local loot = getMatchingLoot()
if #loot == 0 then
setLog("No loot found.")
busy = false
return false
end
setLog("Found " .. #loot .. " items...")
for i, m in ipairs(loot) do
if not m or not m.Parent then continue end
local ok, pv = pcall(function() return m:GetPivot() end)
if ok then
safeTp(pv + Vector3.new(0, 1, 0))
end
task.wait(TELEPORT_DELAY)
if i % 15 == 0 then setLog("Collecting " .. i .. "/" .. #loot) end
end
-- Второй проход
task.wait(0.3)
local remaining = getMatchingLoot()
if #remaining > 0 then
setLog("Picking up " .. #remaining .. " remaining...")
for _, m in ipairs(remaining) do
if not m or not m.Parent then continue end
local ok, pv = pcall(function() return m:GetPivot() end)
if ok then
safeTp(pv + Vector3.new(0, 1, 0))
end
task.wait(TELEPORT_DELAY)
end
end
setLog("Collected all.")
busy = false
return true
end
local function doCollectAndHome()
doCollect()
task.wait(0.2)
doHome()
end
--// SELL
local function doSell()
setLog("Selling...")
local ok = pcall(function()
ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("SellRequest"):FireServer({Mode = "SellAll"})
end)
setLog(ok and "Sold!" or "Sell error!")
return ok
end
--// EQUIP
local function doEquipStick()
setLog("Equipping stick...")
pcall(function()
ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("HoldSlotRequest"):FireServer(1)
end)
task.wait(0.8)
if hasHeldItem() then return true end
pcall(function()
ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("HoldSlotRequest"):FireServer(1)
end)
task.wait(0.8)
return hasHeldItem()
end
--// SPLIT
local function doSplit()
setLog("Splitting...")
local sz = getSplitZone()
if not sz then setLog("SplitZone not found!") return false end
waitChar()
local targetCF = CFrame.new(sz.Position.X, sz.Position.Y + sz.Size.Y / 2 + 1, sz.Position.Z)
safeTp(targetCF)
task.wait(0.3)
freezeCharacter()
task.wait(0.2)
if not hasHeldItem() then
if not doEquipStick() then
setLog("Cannot equip stick!")
return false
end
end
safeTp(targetCF)
task.wait(0.15)
freezeCharacter()
local ok = pcall(function()
ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("SplitRequest"):FireServer(1, true)
end)
setLog(ok and "Split done!" or "Split error!")
return ok
end
--// АВТОФАРМ
-- Home (сдать) → SplitZone → Split → Ждём лут → Collect → Home (сдать) → Sell → повтор
local function autoFarmLoop()
if AUTO_LOOP_RUNNING then return end
AUTO_LOOP_RUNNING = true
setLog("Auto Farm STARTED!")
autoFarmBtn.BackgroundColor3 = Color3.fromRGB(0, 140, 50)
updateBindTexts()
while AUTO_FARMING do
pcall(detectPlayerPlot)
updateStatus()
pcall(function()
islandDropdown.Text = CURRENT_ISLAND or "?"
plotDropdown.Text = CURRENT_PLOT or "?"
end)
-- 1) Home — сдать что есть
setLog("[Auto] Home (deliver)...")
doHome()
task.wait(0.5)
if not AUTO_FARMING then break end
-- 2) Split (с ретраями)
local splitOk = false
for attempt = 1, MAX_SPLIT_RETRIES do
if not AUTO_FARMING then break end
setLog("[Auto] Split attempt " .. attempt .. "/" .. MAX_SPLIT_RETRIES)
splitOk = doSplit()
if splitOk then break end
task.wait(0.5)
end
if not AUTO_FARMING then break end
-- 3) Ждём лут
setLog("[Auto] Waiting for loot...")
local waitTime = 0
local lootFound = false
while waitTime < SPLIT_WAIT_TIME and AUTO_FARMING do
local loot = getMatchingLoot()
if #loot > 0 then
setLog("[Auto] Loot: " .. #loot .. " items!")
lootFound = true
task.wait(0.6)
break
end
task.wait(0.3)
waitTime = waitTime + 0.3
end
if not AUTO_FARMING then break end
-- Если лута нет — повтор сплита
if not lootFound then
setLog("[Auto] No loot, retrying...")
continue
end
-- 4) Collect
setLog("[Auto] Collecting...")
doCollect()
task.wait(0.3)
if not AUTO_FARMING then break end
-- 5) Home — сдать собранное
setLog("[Auto] Home (deliver)...")
doHome()
task.wait(0.5)
if not AUTO_FARMING then break end
-- 6) Sell
setLog("[Auto] Selling...")
doSell()
task.wait(0.3)
if not AUTO_FARMING then break end
-- 7) Проверка остатков
local leftover = getMatchingLoot()
if #leftover > 0 then
setLog("[Auto] Leftover: " .. #leftover .. ", collecting...")
doCollect()
task.wait(0.2)
doHome()
task.wait(0.3)
doSell()
task.wait(0.2)
end
if not AUTO_FARMING then break end
setLog("[Auto] Cycle done!")
task.wait(0.2)
end
setLog("Auto Farm STOPPED.")
autoFarmBtn.BackgroundColor3 = Color3.fromRGB(80, 20, 20)
AUTO_LOOP_RUNNING = false
updateBindTexts()
end
--// КНОПКИ
collectBtn.MouseButton1Click:Connect(function()
if AUTO_FARMING then return end
task.spawn(doCollectAndHome)
end)
homeBtn.MouseButton1Click:Connect(function()
if AUTO_FARMING then return end
doHome()
end)
sellBtn.MouseButton1Click:Connect(function()
if AUTO_FARMING then return end
doSell()
end)
splitBtn.MouseButton1Click:Connect(function()
if AUTO_FARMING then return end
task.spawn(doSplit)
end)
autoFarmBtn.MouseButton1Click:Connect(function()
AUTO_FARMING = not AUTO_FARMING
if AUTO_FARMING then task.spawn(autoFarmLoop) else setLog("Stopping...") end
updateBindTexts()
end)
--// КЛАВИШИ
UserInputService.InputBegan:Connect(function(input, gp)
if gp then return end
if not input.KeyCode or input.KeyCode == Enum.KeyCode.Unknown then return end
if bindListening then
BINDS[bindListening] = input.KeyCode
local b = bindButtons[bindListening]
if b then b.BackgroundColor3 = Color3.fromRGB(48, 48, 65) end
setLog("'" .. bindListening .. "' → [" .. input.KeyCode.Name .. "]")
bindListening = nil
updateBindTexts()
return
end
if input.KeyCode == BINDS.AutoFarm then
AUTO_FARMING = not AUTO_FARMING
if AUTO_FARMING then task.spawn(autoFarmLoop) else setLog("Stopping...") end
updateBindTexts()
return
end
if AUTO_FARMING then return end
if input.KeyCode == BINDS.Collect then
task.spawn(doCollectAndHome)
elseif input.KeyCode == BINDS.Home then
doHome()
elseif input.KeyCode == BINDS.Split then
task.spawn(doSplit)
elseif input.KeyCode == BINDS.SellAll then
doSell()
end
end)
local function isInCyberTechSafeZone()
if CURRENT_ISLAND ~= "CyberTech" then return false end
local ch = player.Character
if not ch then return false end
local hrp = ch:FindFirstChild("HumanoidRootPart")
if not hrp then return false end
local distance = (hrp.Position - CYBERTECH_SAFEZONE_POS).Magnitude
return distance <= CYBERTECH_SAFEZONE_RADIUS
end
updateBindTexts()
task.spawn(function()
task.wait(1)
detectPlayerPlot()
pcall(function()
islandDropdown.Text = CURRENT_ISLAND or "?"
plotDropdown.Text = CURRENT_PLOT or "?"
end)
updateStatus()
updateBindTexts()
setLog("Detected: " .. tostring(CURRENT_ISLAND) .. "/" .. tostring(CURRENT_PLOT))
end)Best Split the Sea auto farm script with auto collect, split, sell, and teleport features. Includes a modern GUI, customizable hotkeys, and a fully automated farming system for fast and efficient gameplay.
No comments yet. Be the first to comment!
1local CYBERTECH_SAFEZONE_POS = Vector3.new(-345.71, 180.80, -3461.89)
2local CYBERTECH_SAFEZONE_RADIUS = 50 -- adjust if needed
3local Players = game:GetService("Players")
4local UserInputService = game:GetService("UserInputService")
5local ReplicatedStorage = game:GetService("ReplicatedStorage")
6
7local player = Players.LocalPlayer
8local playerGui = player:WaitForChild("PlayerGui")
9
10local oldGui = playerGui:FindFirstChild("LootControllerGui")
11if oldGui then oldGui:Destroy() end
12
13local CURRENT_PLOT = nil
14local CURRENT_ISLAND = nil
15local TELEPORT_DELAY = 0.08
16local AUTO_FARMING = false
17local AUTO_LOOP_RUNNING = false
18local SPLIT_WAIT_TIME = 10
19local MAX_SPLIT_RETRIES = 3
20
21local ISLANDS = {"Basic", "VoidReef", "CyberTech", "RainbowReef", "RadioactiveReef"}
22local PLOTS = {"Plot1", "Plot2", "Plot3", "Plot4", "Plot5"}
23
24local BINDS = {
25 Collect = Enum.KeyCode.G,
26 Home = Enum.KeyCode.F,
27 Split = Enum.KeyCode.H,
28 AutoFarm = Enum.KeyCode.J,
29 SellAll = Enum.KeyCode.K,
30}
31local BIND_NAMES = {"Collect", "Home", "Split", "AutoFarm", "SellAll"}
32
33local lootFolder = workspace:WaitForChild("ActiveLoot")
34local busy = false
35local bindListening = nil
36
37local function freezeCharacter()
38 local ch = player.Character
39 if not ch then return end
40 local hrp = ch:FindFirstChild("HumanoidRootPart")
41 local hum = ch:FindFirstChild("Humanoid")
42 if hrp then
43 hrp.Velocity = Vector3.new(0, 0, 0)
44 hrp.AssemblyLinearVelocity = Vector3.new(0, 0, 0)
45 hrp.AssemblyAngularVelocity = Vector3.new(0, 0, 0)
46 end
47 if hum then
48 hum:ChangeState(Enum.HumanoidStateType.Running)
49 end
50end
51
52local function safeTp(cf)
53 local ch = player.Character
54 if not ch then return false end
55 local hrp = ch:FindFirstChild("HumanoidRootPart")
56 if not hrp then return false end
57 hrp.Velocity = Vector3.new(0, 0, 0)
58 hrp.AssemblyLinearVelocity = Vector3.new(0, 0, 0)
59 hrp.AssemblyAngularVelocity = Vector3.new(0, 0, 0)
60 hrp.CFrame = cf
61 task.wait()
62 hrp.Velocity = Vector3.new(0, 0, 0)
63 hrp.AssemblyLinearVelocity = Vector3.new(0, 0, 0)
64 hrp.AssemblyAngularVelocity = Vector3.new(0, 0, 0)
65 local hum = ch:FindFirstChild("Humanoid")
66 if hum then hum:ChangeState(Enum.HumanoidStateType.Running) end
67 return true
68end
69
70local function waitChar()
71 local c = player.Character or player.CharacterAdded:Wait()
72 c:WaitForChild("HumanoidRootPart")
73 c:WaitForChild("Humanoid")
74 return c
75end
76
77local function hasHeldItem()
78 local ch = player.Character
79 if not ch then return false end
80 if ch:FindFirstChild("HeldItem") then return true end
81 local bs = ch:FindFirstChild("BackStick")
82 if bs then
83 local cube = bs:FindFirstChild("Cube.004")
84 if cube and cube:IsA("BasePart") and cube.Transparency >= 0.99 then
85 return true
86 end
87 end
88 return false
89end
90
91local function detectPlayerPlot()
92 local islands = workspace:FindFirstChild("Islands")
93 if not islands then return end
94 for _, islandName in ipairs(ISLANDS) do
95 local island = islands:FindFirstChild(islandName)
96 if not island then continue end
97 local plots = island:FindFirstChild("Plots")
98 if not plots then continue end
99 for _, plot in ipairs(plots:GetChildren()) do
100 local ownerId = plot:GetAttribute("OwnerUserId")
101 if ownerId and ownerId == player.UserId then
102 CURRENT_ISLAND = islandName
103 CURRENT_PLOT = plot.Name
104 return
105 end
106 end
107 end
108 if not CURRENT_ISLAND then CURRENT_ISLAND = "Basic" end
109 if not CURRENT_PLOT then CURRENT_PLOT = "Plot1" end
110end
111
112detectPlayerPlot()
113
114task.spawn(function()
115 while true do
116 task.wait(5)
117 detectPlayerPlot()
118 pcall(function()
119 if islandDropdown then islandDropdown.Text = CURRENT_ISLAND end
120 if plotDropdown then plotDropdown.Text = CURRENT_PLOT end
121 if statusLabel then statusLabel.Text = "🌍 " .. tostring(CURRENT_ISLAND) .. " / " .. tostring(CURRENT_PLOT) end
122 end)
123 end
124end)
125
126--// GUI
127local screenGui = Instance.new("ScreenGui", playerGui)
128screenGui.Name = "LootControllerGui"
129screenGui.ResetOnSpawn = false
130
131local miniButton = Instance.new("TextButton", screenGui)
132miniButton.Size = UDim2.new(0, 36, 0, 36)
133miniButton.Position = UDim2.new(0.1, 0, 0.15, 0)
134miniButton.BackgroundColor3 = Color3.fromRGB(0, 150, 255)
135miniButton.Text = "⚡"
136miniButton.TextColor3 = Color3.new(1, 1, 1)
137miniButton.Font = Enum.Font.GothamBold
138miniButton.TextSize = 16
139miniButton.Visible = false
140miniButton.Active = true
141miniButton.Draggable = true
142Instance.new("UICorner", miniButton).CornerRadius = UDim.new(0, 8)
143
144local frame = Instance.new("Frame", screenGui)
145frame.Name = "MainFrame"
146frame.Size = UDim2.new(0, 245, 0, 405)
147frame.Position = UDim2.new(0.1, 0, 0.1, 0)
148frame.BackgroundColor3 = Color3.fromRGB(18, 18, 28)
149frame.Active = true
150frame.Draggable = true
151frame.BorderSizePixel = 0
152Instance.new("UICorner", frame).CornerRadius = UDim.new(0, 8)
153local fStroke = Instance.new("UIStroke", frame)
154fStroke.Color = Color3.fromRGB(0, 130, 255)
155fStroke.Thickness = 1.5
156
157local titleBar = Instance.new("Frame", frame)
158titleBar.Size = UDim2.new(1, 0, 0, 26)
159titleBar.BackgroundColor3 = Color3.fromRGB(0, 100, 180)
160titleBar.BorderSizePixel = 0
161Instance.new("UICorner", titleBar).CornerRadius = UDim.new(0, 8)
162
163local title = Instance.new("TextLabel", titleBar)
164title.Size = UDim2.new(1, -30, 1, 0)
165title.Position = UDim2.new(0, 6, 0, 0)
166title.Text = "⚡ Loot Ctrl"
167title.BackgroundTransparency = 1
168title.TextColor3 = Color3.new(1, 1, 1)
169title.Font = Enum.Font.GothamBold
170title.TextSize = 11
171title.TextXAlignment = Enum.TextXAlignment.Left
172
173local minimizeBtn = Instance.new("TextButton", titleBar)
174minimizeBtn.Size = UDim2.new(0, 20, 0, 20)
175minimizeBtn.Position = UDim2.new(1, -23, 0, 3)
176minimizeBtn.Text = "−"
177minimizeBtn.TextColor3 = Color3.new(1, 1, 1)
178minimizeBtn.BackgroundColor3 = Color3.fromRGB(180, 40, 40)
179minimizeBtn.Font = Enum.Font.GothamBold
180minimizeBtn.TextSize = 14
181minimizeBtn.BorderSizePixel = 0
182Instance.new("UICorner", minimizeBtn).CornerRadius = UDim.new(0, 5)
183
184statusLabel = Instance.new("TextLabel", frame)
185statusLabel.Size = UDim2.new(1, -14, 0, 14)
186statusLabel.Position = UDim2.new(0, 7, 0, 28)
187statusLabel.Text = "🌍 " .. tostring(CURRENT_ISLAND) .. " / " .. tostring(CURRENT_PLOT)
188statusLabel.BackgroundTransparency = 1
189statusLabel.TextColor3 = Color3.fromRGB(0, 255, 120)
190statusLabel.Font = Enum.Font.GothamBold
191statusLabel.TextSize = 10
192statusLabel.TextXAlignment = Enum.TextXAlignment.Left
193
194local function updateStatus()
195 statusLabel.Text = "🌍 " .. tostring(CURRENT_ISLAND) .. " / " .. tostring(CURRENT_PLOT)
196end
197
198local function createDropdown(parent, position, options, default, callback)
199 local container = Instance.new("Frame", parent)
200 container.Position = position
201 container.Size = UDim2.new(0, 225, 0, 20)
202 container.BackgroundColor3 = Color3.fromRGB(38, 38, 52)
203 container.ZIndex = 2
204 container.BorderSizePixel = 0
205 Instance.new("UICorner", container).CornerRadius = UDim.new(0, 5)
206
207 local button = Instance.new("TextButton", container)
208 button.Size = UDim2.new(1, 0, 1, 0)
209 button.Text = default or options[1]
210 button.TextColor3 = Color3.new(1, 1, 1)
211 button.BackgroundTransparency = 1
212 button.ZIndex = 3
213 button.Font = Enum.Font.Gotham
214 button.TextSize = 10
215
216 local listFrame = Instance.new("ScrollingFrame", container)
217 listFrame.Position = UDim2.new(0, 0, 1, 2)
218 listFrame.Size = UDim2.new(1, 0, 0, math.min(#options * 20, 100))
219 listFrame.CanvasSize = UDim2.new(0, 0, 0, #options * 20)
220 listFrame.BackgroundColor3 = Color3.fromRGB(28, 28, 42)
221 listFrame.Visible = false
222 listFrame.ZIndex = 10
223 listFrame.BorderSizePixel = 0
224 listFrame.ScrollBarThickness = 3
225 Instance.new("UICorner", listFrame).CornerRadius = UDim.new(0, 5)
226
227 for i, option in ipairs(options) do
228 local opt = Instance.new("TextButton", listFrame)
229 opt.Size = UDim2.new(1, 0, 0, 20)
230 opt.Position = UDim2.new(0, 0, 0, (i - 1) * 20)
231 opt.Text = option
232 opt.BackgroundTransparency = 0.6
233 opt.BackgroundColor3 = Color3.fromRGB(50, 50, 65)
234 opt.TextColor3 = Color3.new(1, 1, 1)
235 opt.ZIndex = 11
236 opt.Font = Enum.Font.Gotham
237 opt.TextSize = 10
238 opt.BorderSizePixel = 0
239 opt.MouseButton1Click:Connect(function()
240 button.Text = option
241 listFrame.Visible = false
242 callback(option)
243 end)
244 end
245 button.MouseButton1Click:Connect(function()
246 listFrame.Visible = not listFrame.Visible
247 end)
248 return button
249end
250
251islandDropdown = createDropdown(frame, UDim2.new(0, 8, 0, 44), ISLANDS, CURRENT_ISLAND, function(v) CURRENT_ISLAND = v updateStatus() end)
252plotDropdown = createDropdown(frame, UDim2.new(0, 8, 0, 68), PLOTS, CURRENT_PLOT, function(v) CURRENT_PLOT = v updateStatus() end)
253
254local function makeBtn(parent, pos, size, text, color)
255 local btn = Instance.new("TextButton", parent)
256 btn.Position = pos
257 btn.Size = size
258 btn.Text = text
259 btn.TextColor3 = Color3.new(1, 1, 1)
260 btn.BackgroundColor3 = color
261 btn.Font = Enum.Font.GothamBold
262 btn.TextSize = 10
263 btn.BorderSizePixel = 0
264 Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 5)
265 return btn
266end
267
268local delayL = Instance.new("TextLabel", frame)
269delayL.Position = UDim2.new(0, 8, 0, 92)
270delayL.Size = UDim2.new(0, 35, 0, 18)
271delayL.Text = "Delay"
272delayL.BackgroundTransparency = 1
273delayL.TextColor3 = Color3.fromRGB(180, 180, 200)
274delayL.Font = Enum.Font.Gotham
275delayL.TextSize = 9
276delayL.TextXAlignment = Enum.TextXAlignment.Left
277
278local delayBox = Instance.new("TextBox", frame)
279delayBox.Position = UDim2.new(0, 45, 0, 92)
280delayBox.Size = UDim2.new(0, 188, 0, 18)
281delayBox.Text = tostring(TELEPORT_DELAY)
282delayBox.TextColor3 = Color3.new(1, 1, 1)
283delayBox.BackgroundColor3 = Color3.fromRGB(38, 38, 52)
284delayBox.Font = Enum.Font.Gotham
285delayBox.TextSize = 10
286delayBox.BorderSizePixel = 0
287Instance.new("UICorner", delayBox).CornerRadius = UDim.new(0, 5)
288delayBox.FocusLost:Connect(function()
289 local v = tonumber(delayBox.Text)
290 if v then TELEPORT_DELAY = v end
291end)
292
293local function sep(y)
294 local s = Instance.new("Frame", frame)
295 s.Position = UDim2.new(0, 8, 0, y)
296 s.Size = UDim2.new(0, 225, 0, 1)
297 s.BackgroundColor3 = Color3.fromRGB(45, 45, 60)
298 s.BorderSizePixel = 0
299end
300
301sep(114)
302
303local collectBtn = makeBtn(frame, UDim2.new(0, 8, 0, 118), UDim2.new(0, 110, 0, 26), "🧲 Collect", Color3.fromRGB(0, 120, 60))
304local homeBtn = makeBtn(frame, UDim2.new(0, 123, 0, 118), UDim2.new(0, 110, 0, 26), "🏠 Home", Color3.fromRGB(0, 75, 165))
305local sellBtn = makeBtn(frame, UDim2.new(0, 8, 0, 148), UDim2.new(0, 110, 0, 26), "💰 Sell All", Color3.fromRGB(170, 120, 0))
306local splitBtn = makeBtn(frame, UDim2.new(0, 123, 0, 148), UDim2.new(0, 110, 0, 26), "🪓 Split", Color3.fromRGB(150, 40, 40))
307
308sep(178)
309
310local autoFarmBtn = makeBtn(frame, UDim2.new(0, 8, 0, 182), UDim2.new(0, 225, 0, 28), "🔄 AUTO FARM: OFF", Color3.fromRGB(80, 20, 20))
311
312sep(214)
313
314local bindsT = Instance.new("TextLabel", frame)
315bindsT.Position = UDim2.new(0, 8, 0, 217)
316bindsT.Size = UDim2.new(0, 225, 0, 12)
317bindsT.Text = "⌨️ BINDS (click to rebind)"
318bindsT.BackgroundTransparency = 1
319bindsT.TextColor3 = Color3.fromRGB(180, 180, 220)
320bindsT.Font = Enum.Font.GothamBold
321bindsT.TextSize = 9
322bindsT.TextXAlignment = Enum.TextXAlignment.Left
323
324local bindButtons = {}
325local function getKeyName(kc) return kc and kc.Name or "?" end
326
327local function updateBindTexts()
328 for _, n in ipairs(BIND_NAMES) do
329 if bindButtons[n] then
330 bindButtons[n].Text = n .. " [" .. getKeyName(BINDS[n]) .. "]"
331 end
332 end
333 collectBtn.Text = "🧲 Collect [" .. getKeyName(BINDS.Collect) .. "]"
334 homeBtn.Text = "🏠 Home [" .. getKeyName(BINDS.Home) .. "]"
335 splitBtn.Text = "🪓 Split [" .. getKeyName(BINDS.Split) .. "]"
336 sellBtn.Text = "💰 Sell [" .. getKeyName(BINDS.SellAll) .. "]"
337 autoFarmBtn.Text = AUTO_FARMING
338 and ("🔄 AUTO: ON [" .. getKeyName(BINDS.AutoFarm) .. "]")
339 or ("🔄 AUTO: OFF [" .. getKeyName(BINDS.AutoFarm) .. "]")
340end
341
342for i, name in ipairs(BIND_NAMES) do
343 local col = (i - 1) % 2
344 local row = math.floor((i - 1) / 2)
345 local btn = makeBtn(frame, UDim2.new(0, 8 + col * 116, 0, 232 + row * 24), UDim2.new(0, 110, 0, 20), name .. " [" .. getKeyName(BINDS[name]) .. "]", Color3.fromRGB(48, 48, 65))
346 btn.TextSize = 9
347 btn.Font = Enum.Font.Gotham
348 bindButtons[name] = btn
349 btn.MouseButton1Click:Connect(function()
350 if bindListening then return end
351 bindListening = name
352 btn.Text = name .. " [...]"
353 btn.BackgroundColor3 = Color3.fromRGB(200, 90, 0)
354 end)
355end
356
357local logLabel = Instance.new("TextLabel", frame)
358logLabel.Position = UDim2.new(0, 8, 0, 310)
359logLabel.Size = UDim2.new(1, -16, 0, 85)
360logLabel.Text = "Ready."
361logLabel.BackgroundTransparency = 1
362logLabel.TextColor3 = Color3.fromRGB(160, 160, 180)
363logLabel.Font = Enum.Font.Gotham
364logLabel.TextSize = 9
365logLabel.TextWrapped = true
366logLabel.TextYAlignment = Enum.TextYAlignment.Top
367logLabel.TextXAlignment = Enum.TextXAlignment.Left
368
369local function setLog(msg) logLabel.Text = "📋 " .. msg end
370
371minimizeBtn.MouseButton1Click:Connect(function()
372 frame.Visible = false
373 miniButton.Visible = true
374 miniButton.Position = frame.Position
375end)
376miniButton.MouseButton1Click:Connect(function()
377 miniButton.Visible = false
378 frame.Position = miniButton.Position
379 frame.Visible = true
380end)
381
382--// ЗОНЫ
383
384local function getSafeZone()
385 -- Special manual SafeZone for CyberTech
386 if CURRENT_ISLAND == "CyberTech" then
387 return {
388 Position = CYBERTECH_SAFEZONE_POS,
389 Size = Vector3.new(CYBERTECH_SAFEZONE_RADIUS, CYBERTECH_SAFEZONE_RADIUS, CYBERTECH_SAFEZONE_RADIUS)
390 }
391 end
392
393 -- Default system for other islands
394 local isl = workspace:FindFirstChild("Islands")
395 if not isl then return nil end
396
397 isl = isl:FindFirstChild(CURRENT_ISLAND)
398 if not isl then return nil end
399
400 local p = isl:FindFirstChild("Plots")
401 if not p then return nil end
402
403 p = p:FindFirstChild(CURRENT_PLOT)
404 if not p then return nil end
405
406 local imp = p:FindFirstChild("Important")
407 if not imp then return nil end
408
409 return imp:FindFirstChild("SafeZone")
410end
411local function getSplitZone()
412 local isl = workspace:FindFirstChild("Islands")
413 if not isl then return nil end
414 isl = isl:FindFirstChild(CURRENT_ISLAND)
415 if not isl then return nil end
416 local p = isl:FindFirstChild("Plots")
417 if not p then return nil end
418 p = p:FindFirstChild(CURRENT_PLOT)
419 if not p then return nil end
420 local imp = p:FindFirstChild("Important")
421 if not imp then return nil end
422 return imp:FindFirstChild("SplitZone")
423end
424
425--// СБОР ЛУТА — ТОЛЬКО СВОЙ ПЛОТ + В РАДИУСЕ 800
426local function getMatchingLoot()
427 local matches = {}
428 local ch = player.Character
429 if not ch then return matches end
430 local hrp = ch:FindFirstChild("HumanoidRootPart")
431 if not hrp then return matches end
432
433 for _, m in ipairs(lootFolder:GetChildren()) do
434 if m:IsA("Model") and m:GetAttribute("PlotName") == CURRENT_PLOT then
435 local ok, pv = pcall(function() return m:GetPivot() end)
436 if ok then
437 local dist = (pv.Position - hrp.Position).Magnitude
438 if dist <= 800 then
439 table.insert(matches, m)
440 end
441 end
442 end
443 end
444 return matches
445end
446
447--// HOME = SafeZone (сдача ресурсов), невысоко
448local function doHome()
449 local sz = getSafeZone()
450 if not sz then
451 setLog("SafeZone not found!")
452 return false
453 end
454
455 waitChar()
456
457 local targetPosition
458
459 if typeof(sz) == "table" then
460 targetPosition = sz.Position + Vector3.new(0, 3, 0)
461 else
462 targetPosition = Vector3.new(
463 sz.Position.X,
464 sz.Position.Y + sz.Size.Y / 2 + 1,
465 sz.Position.Z
466 )
467 end
468
469 local targetCF = CFrame.new(targetPosition)
470 safeTp(targetCF)
471 task.wait(0.1)
472 freezeCharacter()
473 setLog("Home (SafeZone).")
474 return true
475end
476--// COLLECT — свой плот, радиус 800
477local function doCollect()
478 if busy then return false end
479 busy = true
480 setLog("Collecting...")
481 waitChar()
482
483 local loot = getMatchingLoot()
484 if #loot == 0 then
485 setLog("No loot found.")
486 busy = false
487 return false
488 end
489
490 setLog("Found " .. #loot .. " items...")
491 for i, m in ipairs(loot) do
492 if not m or not m.Parent then continue end
493 local ok, pv = pcall(function() return m:GetPivot() end)
494 if ok then
495 safeTp(pv + Vector3.new(0, 1, 0))
496 end
497 task.wait(TELEPORT_DELAY)
498 if i % 15 == 0 then setLog("Collecting " .. i .. "/" .. #loot) end
499 end
500
501 -- Второй проход
502 task.wait(0.3)
503 local remaining = getMatchingLoot()
504 if #remaining > 0 then
505 setLog("Picking up " .. #remaining .. " remaining...")
506 for _, m in ipairs(remaining) do
507 if not m or not m.Parent then continue end
508 local ok, pv = pcall(function() return m:GetPivot() end)
509 if ok then
510 safeTp(pv + Vector3.new(0, 1, 0))
511 end
512 task.wait(TELEPORT_DELAY)
513 end
514 end
515
516 setLog("Collected all.")
517 busy = false
518 return true
519end
520
521local function doCollectAndHome()
522 doCollect()
523 task.wait(0.2)
524 doHome()
525end
526
527--// SELL
528local function doSell()
529 setLog("Selling...")
530 local ok = pcall(function()
531 ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("SellRequest"):FireServer({Mode = "SellAll"})
532 end)
533 setLog(ok and "Sold!" or "Sell error!")
534 return ok
535end
536
537--// EQUIP
538local function doEquipStick()
539 setLog("Equipping stick...")
540 pcall(function()
541 ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("HoldSlotRequest"):FireServer(1)
542 end)
543 task.wait(0.8)
544 if hasHeldItem() then return true end
545 pcall(function()
546 ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("HoldSlotRequest"):FireServer(1)
547 end)
548 task.wait(0.8)
549 return hasHeldItem()
550end
551
552--// SPLIT
553local function doSplit()
554 setLog("Splitting...")
555 local sz = getSplitZone()
556 if not sz then setLog("SplitZone not found!") return false end
557 waitChar()
558
559 local targetCF = CFrame.new(sz.Position.X, sz.Position.Y + sz.Size.Y / 2 + 1, sz.Position.Z)
560 safeTp(targetCF)
561 task.wait(0.3)
562 freezeCharacter()
563 task.wait(0.2)
564
565 if not hasHeldItem() then
566 if not doEquipStick() then
567 setLog("Cannot equip stick!")
568 return false
569 end
570 end
571
572 safeTp(targetCF)
573 task.wait(0.15)
574 freezeCharacter()
575
576 local ok = pcall(function()
577 ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("SplitRequest"):FireServer(1, true)
578 end)
579 setLog(ok and "Split done!" or "Split error!")
580 return ok
581end
582
583--// АВТОФАРМ
584-- Home (сдать) → SplitZone → Split → Ждём лут → Collect → Home (сдать) → Sell → повтор
585local function autoFarmLoop()
586 if AUTO_LOOP_RUNNING then return end
587 AUTO_LOOP_RUNNING = true
588 setLog("Auto Farm STARTED!")
589 autoFarmBtn.BackgroundColor3 = Color3.fromRGB(0, 140, 50)
590 updateBindTexts()
591
592 while AUTO_FARMING do
593 pcall(detectPlayerPlot)
594 updateStatus()
595 pcall(function()
596 islandDropdown.Text = CURRENT_ISLAND or "?"
597 plotDropdown.Text = CURRENT_PLOT or "?"
598 end)
599
600 -- 1) Home — сдать что есть
601 setLog("[Auto] Home (deliver)...")
602 doHome()
603 task.wait(0.5)
604 if not AUTO_FARMING then break end
605
606 -- 2) Split (с ретраями)
607 local splitOk = false
608 for attempt = 1, MAX_SPLIT_RETRIES do
609 if not AUTO_FARMING then break end
610 setLog("[Auto] Split attempt " .. attempt .. "/" .. MAX_SPLIT_RETRIES)
611 splitOk = doSplit()
612 if splitOk then break end
613 task.wait(0.5)
614 end
615 if not AUTO_FARMING then break end
616
617 -- 3) Ждём лут
618 setLog("[Auto] Waiting for loot...")
619 local waitTime = 0
620 local lootFound = false
621 while waitTime < SPLIT_WAIT_TIME and AUTO_FARMING do
622 local loot = getMatchingLoot()
623 if #loot > 0 then
624 setLog("[Auto] Loot: " .. #loot .. " items!")
625 lootFound = true
626 task.wait(0.6)
627 break
628 end
629 task.wait(0.3)
630 waitTime = waitTime + 0.3
631 end
632 if not AUTO_FARMING then break end
633
634 -- Если лута нет — повтор сплита
635 if not lootFound then
636 setLog("[Auto] No loot, retrying...")
637 continue
638 end
639
640 -- 4) Collect
641 setLog("[Auto] Collecting...")
642 doCollect()
643 task.wait(0.3)
644 if not AUTO_FARMING then break end
645
646 -- 5) Home — сдать собранное
647 setLog("[Auto] Home (deliver)...")
648 doHome()
649 task.wait(0.5)
650 if not AUTO_FARMING then break end
651
652 -- 6) Sell
653 setLog("[Auto] Selling...")
654 doSell()
655 task.wait(0.3)
656 if not AUTO_FARMING then break end
657
658 -- 7) Проверка остатков
659 local leftover = getMatchingLoot()
660 if #leftover > 0 then
661 setLog("[Auto] Leftover: " .. #leftover .. ", collecting...")
662 doCollect()
663 task.wait(0.2)
664 doHome()
665 task.wait(0.3)
666 doSell()
667 task.wait(0.2)
668 end
669 if not AUTO_FARMING then break end
670
671 setLog("[Auto] Cycle done!")
672 task.wait(0.2)
673 end
674
675 setLog("Auto Farm STOPPED.")
676 autoFarmBtn.BackgroundColor3 = Color3.fromRGB(80, 20, 20)
677 AUTO_LOOP_RUNNING = false
678 updateBindTexts()
679end
680
681--// КНОПКИ
682collectBtn.MouseButton1Click:Connect(function()
683 if AUTO_FARMING then return end
684 task.spawn(doCollectAndHome)
685end)
686homeBtn.MouseButton1Click:Connect(function()
687 if AUTO_FARMING then return end
688 doHome()
689end)
690sellBtn.MouseButton1Click:Connect(function()
691 if AUTO_FARMING then return end
692 doSell()
693end)
694splitBtn.MouseButton1Click:Connect(function()
695 if AUTO_FARMING then return end
696 task.spawn(doSplit)
697end)
698autoFarmBtn.MouseButton1Click:Connect(function()
699 AUTO_FARMING = not AUTO_FARMING
700 if AUTO_FARMING then task.spawn(autoFarmLoop) else setLog("Stopping...") end
701 updateBindTexts()
702end)
703
704--// КЛАВИШИ
705UserInputService.InputBegan:Connect(function(input, gp)
706 if gp then return end
707 if not input.KeyCode or input.KeyCode == Enum.KeyCode.Unknown then return end
708
709 if bindListening then
710 BINDS[bindListening] = input.KeyCode
711 local b = bindButtons[bindListening]
712 if b then b.BackgroundColor3 = Color3.fromRGB(48, 48, 65) end
713 setLog("'" .. bindListening .. "' → [" .. input.KeyCode.Name .. "]")
714 bindListening = nil
715 updateBindTexts()
716 return
717 end
718
719 if input.KeyCode == BINDS.AutoFarm then
720 AUTO_FARMING = not AUTO_FARMING
721 if AUTO_FARMING then task.spawn(autoFarmLoop) else setLog("Stopping...") end
722 updateBindTexts()
723 return
724 end
725
726 if AUTO_FARMING then return end
727
728 if input.KeyCode == BINDS.Collect then
729 task.spawn(doCollectAndHome)
730 elseif input.KeyCode == BINDS.Home then
731 doHome()
732 elseif input.KeyCode == BINDS.Split then
733 task.spawn(doSplit)
734 elseif input.KeyCode == BINDS.SellAll then
735 doSell()
736 end
737end)
738local function isInCyberTechSafeZone()
739 if CURRENT_ISLAND ~= "CyberTech" then return false end
740
741 local ch = player.Character
742 if not ch then return false end
743
744 local hrp = ch:FindFirstChild("HumanoidRootPart")
745 if not hrp then return false end
746
747 local distance = (hrp.Position - CYBERTECH_SAFEZONE_POS).Magnitude
748 return distance <= CYBERTECH_SAFEZONE_RADIUS
749end
750updateBindTexts()
751task.spawn(function()
752 task.wait(1)
753 detectPlayerPlot()
754 pcall(function()
755 islandDropdown.Text = CURRENT_ISLAND or "?"
756 plotDropdown.Text = CURRENT_PLOT or "?"
757 end)
758 updateStatus()
759 updateBindTexts()
760 setLog("Detected: " .. tostring(CURRENT_ISLAND) .. "/" .. tostring(CURRENT_PLOT))
761end)