Auto farm legends
Key Required

Auto farm legends

Legends Of Speed ⚡Swrod1kSwrod1k 1.2K views 288 executesUpdated Dec 17, 2025
3.3/ 5(3 votes)
2167% Positive
Lua Script•603 lines (20216 chars)
-- Создание ScreenGui
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "FarmGui"
ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
ScreenGui.ResetOnSpawn = false

-- Основной фрейм
local MainFrame = Instance.new("Frame")
MainFrame.Name = "MainFrame"
MainFrame.Size = UDim2.new(0, 250, 0, 320) -- Увеличил высоту для новой кнопки
MainFrame.Position = UDim2.new(0.5, -125, 0.5, -160)
MainFrame.AnchorPoint = Vector2.new(0.5, 0.5)
MainFrame.BackgroundColor3 = Color3.fromRGB(30, 0, 50)
MainFrame.BackgroundTransparency = 0.1
MainFrame.BorderSizePixel = 0

-- Яркий фиолетовый градиент
local Gradient = Instance.new("UIGradient")
Gradient.Color = ColorSequence.new({
    ColorSequenceKeypoint.new(0, Color3.fromRGB(180, 0, 255)),
    ColorSequenceKeypoint.new(0.5, Color3.fromRGB(210, 0, 255)),
    ColorSequenceKeypoint.new(1, Color3.fromRGB(150, 0, 230))
})
Gradient.Rotation = 135
Gradient.Transparency = NumberSequence.new(0.05)
Gradient.Parent = MainFrame

-- Скругление углов
local BackgroundCorner = Instance.new("UICorner")
BackgroundCorner.CornerRadius = UDim.new(0, 12)
BackgroundCorner.Parent = MainFrame

-- Заголовок
local Title = Instance.new("TextLabel")
Title.Name = "Title"
Title.Size = UDim2.new(1, -20, 0, 30)
Title.Position = UDim2.new(0, 10, 0, 5)
Title.BackgroundTransparency = 1
Title.Text = "⚡ ROBLOXMAN ⚡"
Title.TextColor3 = Color3.fromRGB(255, 220, 255)
Title.TextScaled = true
Title.Font = Enum.Font.GothamBold
Title.TextStrokeTransparency = 0.6
Title.TextStrokeColor3 = Color3.fromRGB(80, 0, 120)
Title.Parent = MainFrame

-- Подзаголовок
local SubTitle = Instance.new("TextLabel")
SubTitle.Name = "SubTitle"
SubTitle.Size = UDim2.new(1, -20, 0, 18)
SubTitle.Position = UDim2.new(0, 10, 0, 32)
SubTitle.BackgroundTransparency = 1
SubTitle.Text = "K - Toggle | v1.1"
SubTitle.TextColor3 = Color3.fromRGB(240, 200, 255)
SubTitle.TextScaled = true
SubTitle.Font = Enum.Font.Gotham
SubTitle.TextSize = 11
SubTitle.Parent = MainFrame

-- Функция создания компактных кнопок
local function createButton(name, text, positionY, width, height)
    local button = Instance.new("TextButton")
    button.Name = name
    button.Size = UDim2.new(width, 0, 0, height)
    button.Position = UDim2.new((1 - width) / 2, 0, positionY, 0)
    button.BackgroundColor3 = Color3.fromRGB(120, 0, 180)
    button.BackgroundTransparency = 0.1
    button.Text = text
    button.TextColor3 = Color3.fromRGB(255, 255, 255)
    button.TextScaled = true
    button.Font = Enum.Font.GothamBold
    button.TextStrokeTransparency = 0.5
    button.TextStrokeColor3 = Color3.fromRGB(40, 0, 60)
    
    -- Градиент кнопки
    local gradient = Instance.new("UIGradient")
    gradient.Color = ColorSequence.new({
        ColorSequenceKeypoint.new(0, Color3.fromRGB(180, 0, 255)),
        ColorSequenceKeypoint.new(1, Color3.fromRGB(140, 0, 220))
    })
    gradient.Parent = button
    
    -- Скругление кнопки
    local corner = Instance.new("UICorner")
    corner.CornerRadius = UDim.new(0, 8)
    corner.Parent = button
    
    -- Анимация при наведении
    button.MouseEnter:Connect(function()
        game:GetService("TweenService"):Create(button, TweenInfo.new(0.15), {
            BackgroundTransparency = 0,
            Size = UDim2.new(width + 0.01, 0, 0, height)
        }):Play()
    end)
    
    button.MouseLeave:Connect(function()
        game:GetService("TweenService"):Create(button, TweenInfo.new(0.15), {
            BackgroundTransparency = 0.1,
            Size = UDim2.new(width, 0, 0, height)
        }):Play()
    end)
    
    return button, gradient
end

-- Создание кнопок
local AutoFarmButton, AutoFarmGradient = createButton("AutoFarmButton", "🚀 AUTO FARM", 0.15, 0.88, 28)
local FlyButton, FlyGradient = createButton("FlyButton", "🦅 FLY: OFF", 0.23, 0.88, 28)
local NoclipButton, NoclipGradient = createButton("NoclipButton", "👻 NOCLIP: OFF", 0.31, 0.88, 28)
local ClickTPButton, ClickTPGradient = createButton("ClickTPButton", "📍 CLICK TP: OFF", 0.39, 0.88, 28)
local OpenEggsButton, OpenEggsGradient = createButton("OpenEggsButton", "🥚 OPEN EGGS", 0.47, 0.88, 28) -- Новая кнопка

-- Компактный фрейм для скорости полета
local SpeedFrame = Instance.new("Frame")
SpeedFrame.Name = "SpeedFrame"
SpeedFrame.Size = UDim2.new(0.88, 0, 0, 35)
SpeedFrame.Position = UDim2.new(0.06, 0, 0.55, 0)
SpeedFrame.BackgroundColor3 = Color3.fromRGB(80, 0, 130)
SpeedFrame.BackgroundTransparency = 0.2
SpeedFrame.BorderSizePixel = 0

local SpeedCorner = Instance.new("UICorner")
SpeedCorner.CornerRadius = UDim.new(0, 8)
SpeedCorner.Parent = SpeedFrame

local SpeedLabel = Instance.new("TextLabel")
SpeedLabel.Name = "SpeedLabel"
SpeedLabel.Size = UDim2.new(0.5, 0, 1, 0)
SpeedLabel.Position = UDim2.new(0, 8, 0, 0)
SpeedLabel.BackgroundTransparency = 1
SpeedLabel.Text = "✈️ SPEED"
SpeedLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
SpeedLabel.TextScaled = true
SpeedLabel.Font = Enum.Font.GothamBold
SpeedLabel.TextXAlignment = Enum.TextXAlignment.Left
SpeedLabel.Parent = SpeedFrame

local SpeedBox = Instance.new("TextBox")
SpeedBox.Name = "SpeedBox"
SpeedBox.Size = UDim2.new(0.4, 0, 0.65, 0)
SpeedBox.Position = UDim2.new(0.55, 0, 0.175, 0)
SpeedBox.BackgroundColor3 = Color3.fromRGB(50, 0, 80)
SpeedBox.BackgroundTransparency = 0.1
SpeedBox.TextColor3 = Color3.fromRGB(255, 255, 255)
SpeedBox.Text = "50"
SpeedBox.TextScaled = true
SpeedBox.Font = Enum.Font.GothamBold
SpeedBox.Parent = SpeedFrame

local SpeedBoxCorner = Instance.new("UICorner")
SpeedBoxCorner.CornerRadius = UDim.new(0, 6)
SpeedBoxCorner.Parent = SpeedBox

SpeedFrame.Parent = MainFrame

-- Кнопка закрытия (маленькая)
local CloseButton = Instance.new("TextButton")
CloseButton.Name = "CloseButton"
CloseButton.Size = UDim2.new(0, 22, 0, 22)
CloseButton.Position = UDim2.new(1, -27, 0, 8)
CloseButton.BackgroundColor3 = Color3.fromRGB(255, 70, 70)
CloseButton.BackgroundTransparency = 0.15
CloseButton.Text = "×"
CloseButton.TextColor3 = Color3.fromRGB(255, 255, 255)
CloseButton.TextScaled = true
CloseButton.Font = Enum.Font.GothamBold
CloseButton.Parent = MainFrame

local CloseCorner = Instance.new("UICorner")
CloseCorner.CornerRadius = UDim.new(1, 0)
CloseCorner.Parent = CloseButton

-- Футер (простой)
local Footer = Instance.new("TextLabel")
Footer.Name = "Footer"
Footer.Size = UDim2.new(1, -20, 0, 18)
Footer.Position = UDim2.new(0, 10, 0.94, 0)
Footer.BackgroundTransparency = 1
Footer.Text = "by RobloxMAN"
Footer.TextColor3 = Color3.fromRGB(220, 180, 255)
Footer.TextScaled = true
Footer.Font = Enum.Font.Gotham
Footer.TextSize = 11
Footer.Parent = MainFrame

-- Добавляем все элементы
AutoFarmButton.Parent = MainFrame
FlyButton.Parent = MainFrame
NoclipButton.Parent = MainFrame
ClickTPButton.Parent = MainFrame
OpenEggsButton.Parent = MainFrame
MainFrame.Parent = ScreenGui

-- Переменные для функций
local isAutoFarming = false
local farmConnection = nil
local startLevel = 0
local lastRebirthLevel = 0

local flyEnabled = false
local noclipEnabled = false
local clickTPEnabled = false
local openEggsEnabled = false
local openEggsConnection = nil

-- Функция получения уровня игрока
local function getPlayerLevel()
    local player = game:GetService("Players").LocalPlayer
    local success, level = pcall(function()
        return player.level.Value
    end)
    return success and level or 1
end

-- Функция перерождения
local function performRebirth()
    local args = {"rebirthRequest"}
    for i = 1, 3 do
        pcall(function()
            game:GetService("ReplicatedStorage"):WaitForChild("rEvents"):WaitForChild("rebirthEvent"):FireServer(unpack(args))
        end)
        if i < 3 then
            wait(0.05)
        end
    end
end

-- Функция фарма всех локаций
local function farmAllCities()
    local locations = {
        {"collectOrb", "Red Orb", "City"},
        {"collectOrb", "Gem", "City"},
        {"collectOrb", "Red Orb", "Snow City"},
        {"collectOrb", "Gem", "Snow City"},
        {"collectOrb", "Red Orb", "Magma City"},
        {"collectOrb", "Gem", "Magma City"},
        {"collectOrb", "Red Orb", "Legends Highway"},
        {"collectOrb", "Gem", "Legends Highway"}
    }
    
    pcall(function()
        local orbEvent = game:GetService("ReplicatedStorage"):WaitForChild("rEvents"):WaitForChild("orbEvent")
        for _, args in ipairs(locations) do
            orbEvent:FireServer(unpack(args))
        end
    end)
end

-- Функция открытия яиц
local function openEgg()
    local args = {
        "openCrystal",
        "Electro Legends Crystal"
    }
    pcall(function()
        game:GetService("ReplicatedStorage"):WaitForChild("rEvents"):WaitForChild("openCrystalRemote"):InvokeServer(unpack(args))
    end)
end

-- Функция старта автофарма
local function startAutoFarm()
    if isAutoFarming then return end
    isAutoFarming = true
    AutoFarmButton.Text = "✅ FARMING"
    AutoFarmGradient.Color = ColorSequence.new({
        ColorSequenceKeypoint.new(0, Color3.fromRGB(0, 255, 100)),
        ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 200, 50))
    })
    
    performRebirth()
    wait(0.5)
    
    local newLevel = getPlayerLevel()
    startLevel = newLevel
    lastRebirthLevel = newLevel
    
    farmConnection = game:GetService("RunService").Heartbeat:Connect(function()
        farmAllCities()
        if tick() % 0.5 < 0.1 then
            local currentLevel = getPlayerLevel()
            if currentLevel > lastRebirthLevel then
                performRebirth()
                lastRebirthLevel = currentLevel
                startLevel = currentLevel
            end
        end
    end)
end

-- Функция остановки автофарма
local function stopAutoFarm()
    if not isAutoFarming then return end
    isAutoFarming = false
    AutoFarmButton.Text = "🚀 AUTO FARM"
    AutoFarmGradient.Color = ColorSequence.new({
        ColorSequenceKeypoint.new(0, Color3.fromRGB(180, 0, 255)),
        ColorSequenceKeypoint.new(1, Color3.fromRGB(140, 0, 220))
    })
    if farmConnection then
        farmConnection:Disconnect()
        farmConnection = nil
    end
    startLevel = 0
    lastRebirthLevel = 0
end

-- Функция старта открытия яиц
local function startOpenEggs()
    if openEggsEnabled then return end
    openEggsEnabled = true
    OpenEggsButton.Text = "🥚 OPENING..."
    OpenEggsGradient.Color = ColorSequence.new({
        ColorSequenceKeypoint.new(0, Color3.fromRGB(0, 255, 100)),
        ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 200, 50))
    })
    
    openEggsConnection = game:GetService("RunService").Heartbeat:Connect(function()
        openEgg()
    end)
end

-- Функция остановки открытия яиц
local function stopOpenEggs()
    if not openEggsEnabled then return end
    openEggsEnabled = false
    OpenEggsButton.Text = "🥚 OPEN EGGS"
    OpenEggsGradient.Color = ColorSequence.new({
        ColorSequenceKeypoint.new(0, Color3.fromRGB(180, 0, 255)),
        ColorSequenceKeypoint.new(1, Color3.fromRGB(140, 0, 220))
    })
    if openEggsConnection then
        openEggsConnection:Disconnect()
        openEggsConnection = nil
    end
end

-- Обработчик кнопки автофарма
AutoFarmButton.MouseButton1Click:Connect(function()
    if not isAutoFarming then
        startAutoFarm()
    else
        stopAutoFarm()
    end
end)

-- Обработчик кнопки открытия яиц
OpenEggsButton.MouseButton1Click:Connect(function()
    if not openEggsEnabled then
        startOpenEggs()
    else
        stopOpenEggs()
    end
end)

-- Функция полета
local flyConnection
local function toggleFly()
    flyEnabled = not flyEnabled
    if flyEnabled then
        FlyButton.Text = "🦅 FLY: ON"
        FlyGradient.Color = ColorSequence.new({
            ColorSequenceKeypoint.new(0, Color3.fromRGB(0, 255, 100)),
            ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 200, 50))
        })
        
        local player = game.Players.LocalPlayer
        local character = player.Character or player.CharacterAdded:Wait()
        local humanoid = character:WaitForChild("Humanoid")
        humanoid.PlatformStand = true
        
        flyConnection = game:GetService("RunService").Heartbeat:Connect(function()
            if not character or not character.PrimaryPart then return end
            
            local speed = tonumber(SpeedBox.Text) or 50
            local cam = workspace.CurrentCamera
            local root = character.PrimaryPart
            
            if cam and root then
                local camCF = cam.CFrame
                local moveVector = Vector3.new(0, 0, 0)
                
                if game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode.W) then
                    moveVector = moveVector + camCF.LookVector
                end
                if game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode.S) then
                    moveVector = moveVector - camCF.LookVector
                end
                if game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode.A) then
                    moveVector = moveVector - camCF.RightVector
                end
                if game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode.D) then
                    moveVector = moveVector + camCF.RightVector
                end
                if game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode.Space) then
                    moveVector = moveVector + Vector3.new(0, 1, 0)
                end
                if game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode.LeftShift) then
                    moveVector = moveVector - Vector3.new(0, 1, 0)
                end
                
                if moveVector.Magnitude > 0 then
                    moveVector = moveVector.Unit * speed
                    root.Velocity = moveVector
                else
                    root.Velocity = Vector3.new(0, 0, 0)
                end
            end
        end)
    else
        FlyButton.Text = "🦅 FLY: OFF"
        FlyGradient.Color = ColorSequence.new({
            ColorSequenceKeypoint.new(0, Color3.fromRGB(180, 0, 255)),
            ColorSequenceKeypoint.new(1, Color3.fromRGB(140, 0, 220))
        })
        
        local player = game.Players.LocalPlayer
        local character = player.Character
        if character then
            local humanoid = character:FindFirstChild("Humanoid")
            if humanoid then
                humanoid.PlatformStand = false
            end
        end
        
        if flyConnection then
            flyConnection:Disconnect()
            flyConnection = nil
        end
    end
end

FlyButton.MouseButton1Click:Connect(toggleFly)

-- Функция ноклипа
local noclipConnection
local function toggleNoclip()
    noclipEnabled = not noclipEnabled
    if noclipEnabled then
        NoclipButton.Text = "👻 NOCLIP: ON"
        NoclipGradient.Color = ColorSequence.new({
            ColorSequenceKeypoint.new(0, Color3.fromRGB(0, 255, 100)),
            ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 200, 50))
        })
        
        local player = game.Players.LocalPlayer
        local character = player.Character or player.CharacterAdded:Wait()
        
        noclipConnection = game:GetService("RunService").Stepped:Connect(function()
            if character then
                for _, part in pairs(character:GetDescendants()) do
                    if part:IsA("BasePart") then
                        part.CanCollide = false
                    end
                end
            end
        end)
    else
        NoclipButton.Text = "👻 NOCLIP: OFF"
        NoclipGradient.Color = ColorSequence.new({
            ColorSequenceKeypoint.new(0, Color3.fromRGB(180, 0, 255)),
            ColorSequenceKeypoint.new(1, Color3.fromRGB(140, 0, 220))
        })
        
        local player = game.Players.LocalPlayer
        local character = player.Character
        if character then
            for _, part in pairs(character:GetDescendants()) do
                if part:IsA("BasePart") then
                    part.CanCollide = true
                end
            end
        end
        
        if noclipConnection then
            noclipConnection:Disconnect()
            noclipConnection = nil
        end
    end
end

NoclipButton.MouseButton1Click:Connect(toggleNoclip)

-- Функция телепорта по клику
local clickTPConnection
local function toggleClickTP()
    clickTPEnabled = not clickTPEnabled
    if clickTPEnabled then
        ClickTPButton.Text = "📍 CLICK TP: ON"
        ClickTPGradient.Color = ColorSequence.new({
            ColorSequenceKeypoint.new(0, Color3.fromRGB(0, 255, 100)),
            ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 200, 50))
        })
        
        clickTPConnection = game:GetService("UserInputService").InputBegan:Connect(function(input, gameProcessed)
            if not gameProcessed and input.UserInputType == Enum.UserInputType.MouseButton1 and 
               game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode.LeftControl) then
                local player = game.Players.LocalPlayer
                local character = player.Character
                if character and character.PrimaryPart then
                    local mouse = player:GetMouse()
                    local targetPos = mouse.Hit.Position + Vector3.new(0, 3, 0)
                    character:SetPrimaryPartCFrame(CFrame.new(targetPos))
                end
            end
        end)
    else
        ClickTPButton.Text = "📍 CLICK TP: OFF"
        ClickTPGradient.Color = ColorSequence.new({
            ColorSequenceKeypoint.new(0, Color3.fromRGB(180, 0, 255)),
            ColorSequenceKeypoint.new(1, Color3.fromRGB(140, 0, 220))
        })
        
        if clickTPConnection then
            clickTPConnection:Disconnect()
            clickTPConnection = nil
        end
    end
end

ClickTPButton.MouseButton1Click:Connect(toggleClickTP)

-- Закрытие GUI
CloseButton.MouseButton1Click:Connect(function()
    stopAutoFarm()
    stopOpenEggs()
    if flyConnection then flyConnection:Disconnect() end
    if noclipConnection then noclipConnection:Disconnect() end
    if clickTPConnection then clickTPConnection:Disconnect() end
    ScreenGui.Enabled = false
end)

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

local function update(input)
    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

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

MainFrame.InputChanged:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseMovement then
        dragInput = input
    end
end)

game:GetService("UserInputService").InputChanged:Connect(function(input)
    if input == dragInput and dragging then
        update(input)
    end
end)

-- Открытие/закрытие GUI по клавише K
local guiVisible = true
game:GetService("UserInputService").InputBegan:Connect(function(input, gameProcessed)
    if not gameProcessed and input.KeyCode == Enum.KeyCode.K then
        guiVisible = not guiVisible
        ScreenGui.Enabled = guiVisible
    end
end)

-- Восстановление автофарма после смерти
game:GetService("Players").LocalPlayer.CharacterAdded:Connect(function()
    if isAutoFarming then
        wait(2)
        startAutoFarm()
    end
    if openEggsEnabled then
        wait(2)
        startOpenEggs()
    end
end)

-- Отслеживание изменения уровня
local player = game:GetService("Players").LocalPlayer
local levelValue = player:WaitForChild("level")

levelValue:GetPropertyChangedSignal("Value"):Connect(function()
    if isAutoFarming then
        local currentLevel = getPlayerLevel()
        wait(0.05)
        if currentLevel > lastRebirthLevel then
            performRebirth()
            lastRebirthLevel = currentLevel
            startLevel = currentLevel
        end
    end
end)

Features & Information

Auto xp Auto gems Auto open egg Fly Noclip ClickTP Discord: dualjuja

Community Comments (0)

No comments yet for this script.

More Scripts for Legends Of Speed ⚡