print("=== FARM GUI START ===") local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local VirtualUser = game:GetService("VirtualUser") local player = Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui", 10) if not playerGui then warn("PlayerGui not found!") return end print("PlayerGui OK, creating GUI...") -- ============================================================ -- MAIN GUI -- ============================================================ local screenGui = Instance.new("ScreenGui") screenGui.Name = "FarmGui" screenGui.ResetOnSpawn = false screenGui.IgnoreGuiInset = true screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling screenGui.Parent = playerGui local frame = Instance.new("Frame") frame.Name = "MainFrame" frame.Size = UDim2.new(0, 280, 0, 450) frame.Position = UDim2.new(0, 20, 0, 60) frame.BackgroundColor3 = Color3.fromRGB(28, 28, 32) frame.BorderSizePixel = 0 frame.Active = true frame.ZIndex = 10 frame.Parent = screenGui local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, 8) corner.Parent = frame -- ============================================================ -- TITLE BAR -- ============================================================ local titleBar = Instance.new("Frame") titleBar.Name = "TitleBar" titleBar.Size = UDim2.new(1, 0, 0, 34) titleBar.BackgroundColor3 = Color3.fromRGB(40, 40, 46) titleBar.BorderSizePixel = 0 titleBar.ZIndex = 11 titleBar.Parent = frame local titleBarCorner = Instance.new("UICorner") titleBarCorner.CornerRadius = UDim.new(0, 8) titleBarCorner.Parent = titleBar local title = Instance.new("TextLabel") title.Size = UDim2.new(1, -80, 1, 0) title.Position = UDim2.new(0, 10, 0, 0) title.BackgroundTransparency = 1 title.Text = "⚡ Orb Farmer" title.TextColor3 = Color3.fromRGB(255, 255, 255) title.Font = Enum.Font.GothamBold title.TextSize = 16 title.TextXAlignment = Enum.TextXAlignment.Left title.ZIndex = 12 title.Parent = titleBar -- Minimize local minBtn = Instance.new("TextButton") minBtn.Size = UDim2.new(0, 28, 0, 28) minBtn.Position = UDim2.new(1, -64, 0, 3) minBtn.BackgroundColor3 = Color3.fromRGB(70, 70, 80) minBtn.Text = "–" minBtn.TextColor3 = Color3.fromRGB(255, 255, 255) minBtn.Font = Enum.Font.GothamBold minBtn.TextSize = 18 minBtn.BorderSizePixel = 0 minBtn.ZIndex = 12 minBtn.Parent = titleBar local minCorner = Instance.new("UICorner") minCorner.CornerRadius = UDim.new(0, 4) minCorner.Parent = minBtn -- Close local closeBtn = Instance.new("TextButton") closeBtn.Size = UDim2.new(0, 28, 0, 28) closeBtn.Position = UDim2.new(1, -32, 0, 3) closeBtn.BackgroundColor3 = Color3.fromRGB(170, 50, 50) closeBtn.Text = "✕" closeBtn.TextColor3 = Color3.fromRGB(255, 255, 255) closeBtn.Font = Enum.Font.GothamBold closeBtn.TextSize = 14 closeBtn.BorderSizePixel = 0 closeBtn.ZIndex = 12 closeBtn.Parent = titleBar local closeCorner = Instance.new("UICorner") closeCorner.CornerRadius = UDim.new(0, 4) closeCorner.Parent = closeBtn -- ============================================================ -- CONTENT -- ============================================================ local content = Instance.new("Frame") content.Name = "Content" content.Size = UDim2.new(1, 0, 1, -34) content.Position = UDim2.new(0, 0, 0, 34) content.BackgroundTransparency = 1 content.ZIndex = 11 content.Parent = frame -- ============================================================ -- DRAG -- ============================================================ local dragging = false local dragStart, startPos titleBar.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position startPos = frame.Position end end) UserInputService.InputChanged:Connect(function(input) if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then local delta = input.Position - dragStart frame.Position = UDim2.new( startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y ) end end) UserInputService.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = false end end) -- ============================================================ -- MINIMIZE / CLOSE -- ============================================================ local minimized = false minBtn.MouseButton1Click:Connect(function() minimized = not minimized content.Visible = not minimized frame.Size = minimized and UDim2.new(0, 280, 0, 34) or UDim2.new(0, 280, 0, 450) minBtn.Text = minimized and "+" or "–" end) closeBtn.MouseButton1Click:Connect(function() screenGui:Destroy() end) -- ============================================================ -- LABEL HELPER -- ============================================================ local function makeLabel(text, yPos) local lbl = Instance.new("TextLabel") lbl.Size = UDim2.new(1, -20, 0, 20) lbl.Position = UDim2.new(0, 10, 0, yPos) lbl.BackgroundTransparency = 1 lbl.Text = text lbl.TextColor3 = Color3.fromRGB(200, 200, 200) lbl.Font = Enum.Font.Gotham lbl.TextSize = 13 lbl.TextXAlignment = Enum.TextXAlignment.Left lbl.ZIndex = 12 lbl.Parent = content return lbl end -- ============================================================ -- ORB COUNTERS -- ============================================================ local sandLabel = makeLabel("SandOrb: 0", 8) local voidLabel = makeLabel("VoidOrb: 0", 30) task.spawn(function() while screenGui.Parent do local sand, void = 0, 0 for _, obj in ipairs(workspace:GetDescendants()) do if obj.Name == "SandOrb" then sand = sand + 1 elseif obj.Name == "VoidOrb" then void = void + 1 end end sandLabel.Text = "SandOrb: " .. sand voidLabel.Text = "VoidOrb: " .. void task.wait(1) end end) -- ============================================================ -- DELAY SLIDER -- ============================================================ local delayLabel = makeLabel("Delay: 0.30s", 58) local delaySlider = Instance.new("TextButton") delaySlider.Size = UDim2.new(1, -20, 0, 22) delaySlider.Position = UDim2.new(0, 10, 0, 80) delaySlider.BackgroundColor3 = Color3.fromRGB(50, 50, 55) delaySlider.Text = "" delaySlider.AutoButtonColor = false delaySlider.BorderSizePixel = 0 delaySlider.ZIndex = 12 delaySlider.Parent = content local delayCorner = Instance.new("UICorner") delayCorner.CornerRadius = UDim.new(0, 4) delayCorner.Parent = delaySlider local delayFill = Instance.new("Frame") delayFill.Size = UDim2.new(0.22, 0, 1, 0) delayFill.BackgroundColor3 = Color3.fromRGB(0, 170, 255) delayFill.BorderSizePixel = 0 delayFill.ZIndex = 13 delayFill.Parent = delaySlider local delayFillCorner = Instance.new("UICorner") delayFillCorner.CornerRadius = UDim.new(0, 4) delayFillCorner.Parent = delayFill -- ============================================================ -- SPEED SLIDER -- ============================================================ local speedLabel = makeLabel("Speed: 16", 118) local speedSlider = Instance.new("TextButton") speedSlider.Size = UDim2.new(1, -20, 0, 22) speedSlider.Position = UDim2.new(0, 10, 0, 140) speedSlider.BackgroundColor3 = Color3.fromRGB(50, 50, 55) speedSlider.Text = "" speedSlider.AutoButtonColor = false speedSlider.BorderSizePixel = 0 speedSlider.ZIndex = 12 speedSlider.Parent = content local speedCorner = Instance.new("UICorner") speedCorner.CornerRadius = UDim.new(0, 4) speedCorner.Parent = speedSlider local speedFill = Instance.new("Frame") speedFill.Size = UDim2.new(0, 0, 1, 0) speedFill.BackgroundColor3 = Color3.fromRGB(255, 180, 0) speedFill.BorderSizePixel = 0 speedFill.ZIndex = 13 speedFill.Parent = speedSlider local speedFillCorner = Instance.new("UICorner") speedFillCorner.CornerRadius = UDim.new(0, 4) speedFillCorner.Parent = speedFill -- ============================================================ -- SLIDER LOGIC -- ============================================================ local MIN_DELAY, MAX_DELAY = 0.1, 1.0 local MIN_SPEED, MAX_SPEED = 16, 200 local currentDelay = 0.3 local currentSpeed = 16 local function setupSlider(slider, fill, minVal, maxVal, onUpdate) local isDragging = false local function update(inputPos) local relX = math.clamp((inputPos.X - slider.AbsolutePosition.X) / slider.AbsoluteSize.X, 0, 1) local value = minVal + (maxVal - minVal) * relX fill.Size = UDim2.new(relX, 0, 1, 0) onUpdate(value) end slider.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then isDragging = true update(input.Position) end end) slider.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then isDragging = false end end) UserInputService.InputChanged:Connect(function(input) if isDragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then update(input.Position) end end) end setupSlider(delaySlider, delayFill, MIN_DELAY, MAX_DELAY, function(val) currentDelay = math.floor(val * 100) / 100 delayLabel.Text = string.format("Delay: %.2fs", currentDelay) end) -- Speed: ставим локально + запоминаем, чтобы применить после респавна local function applySpeed() local char = player.Character if char then local hum = char:FindFirstChildOfClass("Humanoid") if hum then hum.WalkSpeed = currentSpeed end end end setupSlider(speedSlider, speedFill, MIN_SPEED, MAX_SPEED, function(val) currentSpeed = math.floor(val) speedLabel.Text = "Speed: " .. currentSpeed applySpeed() end) player.CharacterAdded:Connect(function(char) char:WaitForChild("Humanoid", 5) task.wait(0.2) applySpeed() end) -- ============================================================ -- START FARM BUTTON -- ============================================================ local startBtn = Instance.new("TextButton") startBtn.Size = UDim2.new(1, -20, 0, 46) startBtn.Position = UDim2.new(0, 10, 0, 175) startBtn.BackgroundColor3 = Color3.fromRGB(0, 170, 0) startBtn.Text = "▶ START FARM" startBtn.TextColor3 = Color3.fromRGB(255, 255, 255) startBtn.Font = Enum.Font.GothamBold startBtn.TextSize = 15 startBtn.BorderSizePixel = 0 startBtn.ZIndex = 12 startBtn.Parent = content local btnCorner = Instance.new("UICorner") btnCorner.CornerRadius = UDim.new(0, 6) btnCorner.Parent = startBtn -- ============================================================ -- ANTI-AFK BUTTON -- ============================================================ local antiAfkBtn = Instance.new("TextButton") antiAfkBtn.Size = UDim2.new(1, -20, 0, 36) antiAfkBtn.Position = UDim2.new(0, 10, 0, 230) antiAfkBtn.BackgroundColor3 = Color3.fromRGB(70, 70, 130) antiAfkBtn.Text = "Anti-AFK: OFF" antiAfkBtn.TextColor3 = Color3.fromRGB(255, 255, 255) antiAfkBtn.Font = Enum.Font.GothamBold antiAfkBtn.TextSize = 14 antiAfkBtn.BorderSizePixel = 0 antiAfkBtn.ZIndex = 12 antiAfkBtn.Parent = content local antiAfkCorner = Instance.new("UICorner") antiAfkCorner.CornerRadius = UDim.new(0, 6) antiAfkCorner.Parent = antiAfkBtn local antiAfkEnabled = false local antiAfkConnection = nil antiAfkBtn.MouseButton1Click:Connect(function() antiAfkEnabled = not antiAfkEnabled if antiAfkEnabled then antiAfkBtn.Text = "Anti-AFK: ON" antiAfkBtn.BackgroundColor3 = Color3.fromRGB(130, 70, 130) if not antiAfkConnection then antiAfkConnection = player.Idled:Connect(function() if not antiAfkEnabled then return end VirtualUser:Button2Down(Vector2.new(0, 0), workspace.CurrentCamera.CFrame) task.wait(1) VirtualUser:Button2Up(Vector2.new(0, 0), workspace.CurrentCamera.CFrame) print("[FarmGui] Anti-AFK triggered") end) end else antiAfkBtn.Text = "Anti-AFK: OFF" antiAfkBtn.BackgroundColor3 = Color3.fromRGB(70, 70, 130) if antiAfkConnection then antiAfkConnection:Disconnect() antiAfkConnection = nil end end end) -- ============================================================ -- STATUS -- ============================================================ local statusLabel = Instance.new("TextLabel") statusLabel.Size = UDim2.new(1, -20, 0, 20) statusLabel.Position = UDim2.new(0, 10, 0, 280) statusLabel.BackgroundTransparency = 1 statusLabel.Text = "Status: idle" statusLabel.TextColor3 = Color3.fromRGB(180, 180, 180) statusLabel.Font = Enum.Font.Gotham statusLabel.TextSize = 12 statusLabel.TextXAlignment = Enum.TextXAlignment.Left statusLabel.ZIndex = 12 statusLabel.Parent = content -- ============================================================ -- FARM LOGIC -- ============================================================ local isFarming = false local function findNearestOrb() local character = player.Character if not character then return nil end local hrp = character:FindFirstChild("HumanoidRootPart") if not hrp then return nil end local nearest, dist = nil, math.huge for _, obj in ipairs(workspace:GetDescendants()) do if obj.Name == "SandOrb" or obj.Name == "VoidOrb" then local part = obj:IsA("BasePart") and obj or obj:FindFirstChildWhichIsA("BasePart", true) if part then local d = (part.Position - hrp.Position).Magnitude if d < dist then dist = d nearest = part end end end end return nearest end local function teleportToOrb() local character = player.Character if not character then return end local hrp = character:FindFirstChild("HumanoidRootPart") if not hrp then return end local orb = findNearestOrb() if orb then hrp.CFrame = CFrame.new(orb.Position + Vector3.new(0, 3, 0)) statusLabel.Text = "Status: teleporting to " .. orb.Name else statusLabel.Text = "Status: no orbs found" end end startBtn.MouseButton1Click:Connect(function() isFarming = not isFarming if isFarming then startBtn.Text = "⏹ STOP FARM" startBtn.BackgroundColor3 = Color3.fromRGB(170, 0, 0) task.spawn(function() while isFarming do pcall(teleportToOrb) task.wait(currentDelay) end end) else startBtn.Text = "▶ START FARM" startBtn.BackgroundColor3 = Color3.fromRGB(0, 170, 0) statusLabel.Text = "Status: stopped" end end) print("=== FARM GUI CREATED ===")