auto farm op
Key Required

auto farm op

Build A Boat For Treasurehard1337gghard1337gg 467 views 496 executesUpdated Aug 7, 2026
Unrated
00
Lua Script•496 lines (15474 chars)
-- // hard1337 Premium Menu - Auto Farm
-- // Created for Roblox

local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local CoreGui = game:GetService("CoreGui")
local RunService = game:GetService("RunService")
local Workspace = game:GetService("Workspace")

local player = Players.LocalPlayer

-- Удаляем старый GUI если есть
if CoreGui:FindFirstChild("hard1337") then
    CoreGui:FindFirstChild("hard1337"):Destroy()
end

-- Создание ScreenGui
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "hard1337"
ScreenGui.Parent = CoreGui
ScreenGui.ResetOnSpawn = false

-- Главный фрейм
local MainFrame = Instance.new("Frame")
MainFrame.Size = UDim2.new(0, 280, 0, 180)
MainFrame.Position = UDim2.new(0.5, -140, 0.5, -90)
MainFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
MainFrame.BorderSizePixel = 0
MainFrame.Parent = ScreenGui

-- Топ-бар
local TopBar = Instance.new("Frame")
TopBar.Size = UDim2.new(1, 0, 0, 30)
TopBar.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
TopBar.BorderSizePixel = 0
TopBar.Parent = MainFrame

-- Заголовок
local Title = Instance.new("TextLabel")
Title.Size = UDim2.new(1, -35, 1, 0)
Title.Position = UDim2.new(0, 10, 0, 0)
Title.BackgroundTransparency = 1
Title.Text = "hard1337"
Title.TextColor3 = Color3.fromRGB(220, 220, 220)
Title.Font = Enum.Font.GothamBold
Title.TextSize = 16
Title.TextXAlignment = Enum.TextXAlignment.Left
Title.Parent = TopBar

-- Кнопка X
local CloseButton = Instance.new("TextButton")
CloseButton.Size = UDim2.new(0, 25, 0, 25)
CloseButton.Position = UDim2.new(1, -28, 0, 2)
CloseButton.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
CloseButton.BorderSizePixel = 0
CloseButton.Text = "X"
CloseButton.TextColor3 = Color3.fromRGB(180, 180, 180)
CloseButton.Font = Enum.Font.GothamBold
CloseButton.TextSize = 12
CloseButton.Parent = TopBar

CloseButton.MouseButton1Click:Connect(function()
    MainFrame.Visible = false
end)

-- Контент фрейм
local ContentFrame = Instance.new("Frame")
ContentFrame.Size = UDim2.new(1, -20, 1, -45)
ContentFrame.Position = UDim2.new(0, 10, 0, 38)
ContentFrame.BackgroundTransparency = 1
ContentFrame.Parent = MainFrame

local UIListLayout = Instance.new("UIListLayout")
UIListLayout.Padding = UDim.new(0, 6)
UIListLayout.Parent = ContentFrame

-- ============================================
-- AUTO FARM SYSTEM
-- ============================================
local AutoFarm = {
    Enabled = false,
    CurrentStage = 1,
    HoverTime = 5,
    FarmCoroutine = nil,
    RespawnConnection = nil
}

local StagePaths = {
    {"BoatStages", "NormalStages", "CaveStage1", "DarknessPart"},
    {"BoatStages", "NormalStages", "CaveStage2", "DarknessPart"},
    {"BoatStages", "NormalStages", "CaveStage3", "DarknessPart"},
    {"BoatStages", "NormalStages", "CaveStage4", "DarknessPart"},
    {"BoatStages", "NormalStages", "CaveStage5", "DarknessPart"},
    {"BoatStages", "NormalStages", "CaveStage6", "DarknessPart"},
    {"BoatStages", "NormalStages", "CaveStage7", "DarknessPart"},
    {"BoatStages", "NormalStages", "CaveStage8", "DarknessPart"},
    {"BoatStages", "NormalStages", "CaveStage9", "DarknessPart"},
    {"BoatStages", "NormalStages", "CaveStage10", "DarknessPart"}
}

function AutoFarm.GetStagePart(stageNumber)
    if stageNumber < 1 or stageNumber > #StagePaths then 
        return nil 
    end
    
    local path = StagePaths[stageNumber]
    local current = Workspace
    
    for _, partName in ipairs(path) do
        if current then 
            current = current:FindFirstChild(partName)
        else 
            return nil 
        end
    end
    
    return current
end

function AutoFarm.TeleportToStage(stageNumber)
    local targetPart = AutoFarm.GetStagePart(stageNumber)
    if not targetPart then 
        return false 
    end
    
    local character = player.Character
    if not character then 
        return false 
    end
    
    local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
    if not humanoidRootPart then 
        return false 
    end
    
    local humanoid = character:FindFirstChild("Humanoid")
    if humanoid then
        humanoid.PlatformStand = true
        humanoid.HipHeight = 0
    end
    
    humanoidRootPart.CFrame = targetPart.CFrame + Vector3.new(0, 5, 0)
    
    local bodyVelocity = humanoidRootPart:FindFirstChild("FarmVelocity")
    if not bodyVelocity then
        bodyVelocity = Instance.new("BodyVelocity")
        bodyVelocity.Name = "FarmVelocity"
        bodyVelocity.MaxForce = Vector3.new(0, 50000, 0)
        bodyVelocity.Parent = humanoidRootPart
    end
    bodyVelocity.Velocity = Vector3.new(0, 0, 0)
    
    return true
end

function AutoFarm.KillCharacter()
    local character = player.Character
    if not character then 
        return 
    end
    
    local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
    if humanoidRootPart then
        local bodyVelocity = humanoidRootPart:FindFirstChild("FarmVelocity")
        if bodyVelocity then 
            bodyVelocity:Destroy() 
        end
    end
    
    local humanoid = character:FindFirstChild("Humanoid")
    if humanoid and humanoid.Health > 0 then
        humanoid.Health = 0
    end
end

function AutoFarm.StartFarmCycle()
    if AutoFarm.FarmCoroutine then 
        task.cancel(AutoFarm.FarmCoroutine) 
    end
    
    AutoFarm.FarmCoroutine = task.spawn(function()
        AutoFarm.CurrentStage = 1
        
        while AutoFarm.Enabled do
            if not player.Character then 
                task.wait(0.5) 
                continue 
            end
            
            local success = AutoFarm.TeleportToStage(AutoFarm.CurrentStage)
            if not success then 
                task.wait(1) 
                continue 
            end
            
            local waitTime = 0
            while waitTime < AutoFarm.HoverTime and AutoFarm.Enabled do
                task.wait(0.1)
                waitTime = waitTime + 0.1
                
                if player.Character then
                    local humanoid = player.Character:FindFirstChild("Humanoid")
                    local humanoidRootPart = player.Character:FindFirstChild("HumanoidRootPart")
                    
                    if humanoid and not humanoid.PlatformStand then
                        humanoid.PlatformStand = true
                        humanoid.HipHeight = 0
                    end
                    
                    if humanoidRootPart then
                        local bodyVelocity = humanoidRootPart:FindFirstChild("FarmVelocity")
                        if bodyVelocity then 
                            bodyVelocity.Velocity = Vector3.new(0, 0, 0) 
                        end
                    end
                end
            end
            
            if not AutoFarm.Enabled then 
                break 
            end
            
            if AutoFarm.CurrentStage >= 10 then
                AutoFarm.KillCharacter()
                while AutoFarm.Enabled and not player.Character do 
                    task.wait(0.5) 
                end
                if AutoFarm.Enabled then 
                    task.wait(0.5) 
                    AutoFarm.CurrentStage = 1 
                end
            else
                AutoFarm.CurrentStage = AutoFarm.CurrentStage + 1
            end
        end
    end)
end

function AutoFarm.Enable()
    if AutoFarm.Enabled then 
        return 
    end
    AutoFarm.Enabled = true
    
    AutoFarm.RespawnConnection = player.CharacterAdded:Connect(function(character)
        if AutoFarm.Enabled then
            task.wait(0.5)
            local humanoid = character:FindFirstChild("Humanoid")
            if humanoid then 
                humanoid.PlatformStand = true 
                humanoid.HipHeight = 0 
            end
            AutoFarm.StartFarmCycle()
        end
    end)
    
    if player.Character then
        local humanoid = player.Character:FindFirstChild("Humanoid")
        if humanoid then 
            humanoid.PlatformStand = true 
            humanoid.HipHeight = 0 
        end
        AutoFarm.StartFarmCycle()
    end
end

function AutoFarm.Disable()
    AutoFarm.Enabled = false
    
    if AutoFarm.FarmCoroutine then 
        task.cancel(AutoFarm.FarmCoroutine) 
        AutoFarm.FarmCoroutine = nil 
    end
    
    if AutoFarm.RespawnConnection then 
        AutoFarm.RespawnConnection:Disconnect() 
        AutoFarm.RespawnConnection = nil 
    end
    
    if player.Character then
        local humanoid = player.Character:FindFirstChild("Humanoid")
        local humanoidRootPart = player.Character:FindFirstChild("HumanoidRootPart")
        
        if humanoid then 
            humanoid.PlatformStand = false 
            humanoid.HipHeight = 2 
        end
        
        if humanoidRootPart then
            local bodyVelocity = humanoidRootPart:FindFirstChild("FarmVelocity")
            if bodyVelocity then 
                bodyVelocity:Destroy() 
            end
        end
    end
end

-- ============================================
-- GUI ELEMENTS
-- ============================================

-- Слайдер Hover Time
local SliderFrame = Instance.new("Frame")
SliderFrame.Size = UDim2.new(1, 0, 0, 50)
SliderFrame.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
SliderFrame.BorderSizePixel = 0
SliderFrame.Parent = ContentFrame

local SliderTitle = Instance.new("TextLabel")
SliderTitle.Size = UDim2.new(0, 100, 0, 18)
SliderTitle.Position = UDim2.new(0, 8, 0, 4)
SliderTitle.BackgroundTransparency = 1
SliderTitle.Text = "Hover Time"
SliderTitle.TextColor3 = Color3.fromRGB(200, 200, 200)
SliderTitle.Font = Enum.Font.GothamBold
SliderTitle.TextSize = 13
SliderTitle.TextXAlignment = Enum.TextXAlignment.Left
SliderTitle.Parent = SliderFrame

local SliderValue = Instance.new("TextLabel")
SliderValue.Size = UDim2.new(0, 40, 0, 18)
SliderValue.Position = UDim2.new(1, -48, 0, 4)
SliderValue.BackgroundTransparency = 1
SliderValue.Text = "5"
SliderValue.TextColor3 = Color3.fromRGB(200, 200, 200)
SliderValue.Font = Enum.Font.GothamBold
SliderValue.TextSize = 13
SliderValue.TextXAlignment = Enum.TextXAlignment.Right
SliderValue.Parent = SliderFrame

local SliderBar = Instance.new("Frame")
SliderBar.Size = UDim2.new(1, -16, 0, 5)
SliderBar.Position = UDim2.new(0, 8, 0, 30)
SliderBar.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
SliderBar.BorderSizePixel = 0
SliderBar.Parent = SliderFrame

local SliderFill = Instance.new("Frame")
SliderFill.Size = UDim2.new(0.44, 0, 1, 0)
SliderFill.BackgroundColor3 = Color3.fromRGB(60, 120, 60)
SliderFill.BorderSizePixel = 0
SliderFill.Parent = SliderBar

local SliderButton = Instance.new("TextButton")
SliderButton.Size = UDim2.new(1, 0, 0, 15)
SliderButton.Position = UDim2.new(0, 8, 0, 25)
SliderButton.BackgroundTransparency = 1
SliderButton.Text = ""
SliderButton.Parent = SliderFrame

local hoverTime = 5
local isDraggingSlider = false

local function UpdateSlider()
    local mousePos = UserInputService:GetMouseLocation()
    local sliderAbsPos = SliderBar.AbsolutePosition
    local sliderAbsSize = SliderBar.AbsoluteSize
    
    local relativeX = math.clamp((mousePos.X - sliderAbsPos.X) / sliderAbsSize.X, 0, 1)
    local newValue = 1 + (10 - 1) * relativeX
    newValue = math.floor(newValue * 10) / 10
    
    SliderFill.Size = UDim2.new(relativeX, 0, 1, 0)
    SliderValue.Text = tostring(newValue)
    AutoFarm.HoverTime = newValue
end

SliderButton.MouseButton1Down:Connect(function()
    isDraggingSlider = true
    UpdateSlider()
end)

UserInputService.InputChanged:Connect(function(input)
    if isDraggingSlider and input.UserInputType == Enum.UserInputType.MouseMovement then
        UpdateSlider()
    end
end)

UserInputService.InputEnded:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 then
        isDraggingSlider = false
    end
end)

-- Переключатель Auto Farm
local ToggleFrame = Instance.new("Frame")
ToggleFrame.Size = UDim2.new(1, 0, 0, 38)
ToggleFrame.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
ToggleFrame.BorderSizePixel = 0
ToggleFrame.Parent = ContentFrame

local ToggleTitle = Instance.new("TextLabel")
ToggleTitle.Size = UDim2.new(0, 150, 1, 0)
ToggleTitle.Position = UDim2.new(0, 10, 0, 0)
ToggleTitle.BackgroundTransparency = 1
ToggleTitle.Text = "Auto Farm"
ToggleTitle.TextColor3 = Color3.fromRGB(200, 200, 200)
ToggleTitle.Font = Enum.Font.GothamBold
ToggleTitle.TextSize = 13
ToggleTitle.TextXAlignment = Enum.TextXAlignment.Left
ToggleTitle.Parent = ToggleFrame

local ToggleBG = Instance.new("Frame")
ToggleBG.Size = UDim2.new(0, 36, 0, 18)
ToggleBG.Position = UDim2.new(1, -46, 0.5, -9)
ToggleBG.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
ToggleBG.BorderSizePixel = 0
ToggleBG.Parent = ToggleFrame

local ToggleKnob = Instance.new("Frame")
ToggleKnob.Size = UDim2.new(0, 14, 0, 14)
ToggleKnob.Position = UDim2.new(0, 2, 0, 2)
ToggleKnob.BackgroundColor3 = Color3.fromRGB(200, 200, 200)
ToggleKnob.BorderSizePixel = 0
ToggleKnob.Parent = ToggleBG

local ToggleButton = Instance.new("TextButton")
ToggleButton.Size = UDim2.new(1, 0, 1, 0)
ToggleButton.BackgroundTransparency = 1
ToggleButton.Text = ""
ToggleButton.Parent = ToggleBG

local autoFarmEnabled = false

ToggleButton.MouseButton1Click:Connect(function()
    autoFarmEnabled = not autoFarmEnabled
    if autoFarmEnabled then
        ToggleBG.BackgroundColor3 = Color3.fromRGB(60, 120, 60)
        ToggleKnob.Position = UDim2.new(0, 20, 0, 2)
        AutoFarm.Enable()
    else
        ToggleBG.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
        ToggleKnob.Position = UDim2.new(0, 2, 0, 2)
        AutoFarm.Disable()
    end
end)

-- Кнопка Destroy
local DestroyButton = Instance.new("TextButton")
DestroyButton.Size = UDim2.new(1, 0, 0, 30)
DestroyButton.BackgroundColor3 = Color3.fromRGB(160, 40, 40)
DestroyButton.BorderSizePixel = 0
DestroyButton.Text = "DESTROY GUI"
DestroyButton.TextColor3 = Color3.fromRGB(255, 255, 255)
DestroyButton.Font = Enum.Font.GothamBold
DestroyButton.TextSize = 13
DestroyButton.Parent = ContentFrame

DestroyButton.MouseButton1Click:Connect(function()
    AutoFarm.Disable()
    ScreenGui:Destroy()
end)

-- ============================================
-- WINDOW CONTROLS
-- ============================================

-- Перетаскивание
local dragging = false
local dragStart = nil
local startPos = nil

TopBar.InputBegan:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 then
        dragging = true
        dragStart = input.Position
        startPos = MainFrame.Position
    end
end)

TopBar.InputEnded:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 then
        dragging = false
    end
end)

UserInputService.InputChanged:Connect(function(input)
    if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
        local delta = input.Position - dragStart
        MainFrame.Position = UDim2.new(
            startPos.X.Scale, 
            startPos.X.Offset + delta.X, 
            startPos.Y.Scale, 
            startPos.Y.Offset + delta.Y
        )
    end
end)

-- Открытие/закрытие по Insert
UserInputService.InputBegan:Connect(function(input, gameProcessed)
    if gameProcessed then return end
    if input.KeyCode == Enum.KeyCode.Insert then 
        MainFrame.Visible = not MainFrame.Visible 
    end
end)

Features & Information

top free

Community Comments (0)

No comments yet for this script.

More Scripts for Build A Boat For Treasure