MEDVED Script (Delta Mobile) – Mono V2: Page Farm, Crate Farm, Bear ESP 17 8 No Key

MEDVED Script (Delta Mobile) – Mono V2: Page Farm, Crate Farm, Bear ESP

MEDVED · Roblox
Play
No key Mobile friendly Working · Nov 3
Report

Description

MEDVED Mono V2 is a MEDVED script you can run in Delta on Android, iOS or PC. It includes auto farm pages, auto farm crates, bear esp and more. The menu labels are in Russian (Автофарм страниц = page farm, Автофарм крейтов = crate farm, ESP медведей = bear ESP). Page and crate farms run one at a time. Created by matveiyga. No key.

Key Features

  • Auto Farm Pages (F6): teleports to each page, collects it and returns you
  • Auto Farm Crates (F7): opens every available crate one by one
  • Bear ESP with labels and distance
  • Friendly Bear marker
  • Tracker Lines to bears
  • Stop button that returns you to your start spot
  • Turn Off Script button
  • RightShift to hide or show the menu

MEDVED drops you in a big snowy map full of mutant bears, with pages and crates scattered between them. Mono V2, matveiyga’s second MEDVED script, handles the collecting and shows you where every bear is while it does. It’s a single open-source file with no key and no web requests.

Page farm and crate farm

The page farm finds the nearest page whose prompt is still active, teleports you about three studs above it, waits a second, fires the prompt, then moves on to the next one. The crate farm works the same way on unopened crates, and once a crate is open it also tries every item prompt inside. Only one farm can run at a time. Press the same button again to stop it. When a farm finishes or you stop it, the script puts you back where you started, as long as your character is still alive and hasn’t changed. The panel shows a running count, such as pages collected out of attempts.

The bear radar

  • Hostile bears get red labels showing their name and distance, and friendly bears get green ones marked “ДРУЖЕЛЮБНЫЙ” (friendly).
  • Tracker lines run from the bottom of your screen to each bear that’s visible.
  • The range goes from 100 to 700 studs in steps of 100, and a counter shows hostile and friendly bears nearby.

The labels are in Russian. Автофарм страниц is the page farm (F6) and Автофарм крейтов is the crate farm (F7). ESP медведей, Дружелюбные медведи and Линии-трекеры toggle the three radar layers, and ВЫКЛЮЧИТЬ СКРИПТ shuts the script down completely. The cover image is a mock-up, and the real window is one scrolling list.

Before you run it

Phones have no F6, F7 or RightShift keys, so use the buttons. The “−” in the header hides the panel and a small MONO button brings it back. Both farms need an executor with fireproximityprompt. Without it the panel says “fireproximityprompt недоступен”. The page names Delta along with Codex, Fluxus, Arceus X and the usual PC executors.

MEDVED questions

Will the farm get me killed? It might. It teleports you right next to each page or crate, bears or not. If you die, it stops and skips the return.

Can I hide the radar but keep farming? Yes. Each ESP layer has its own switch, and they’re separate from the farms.

Snow tip: look at the bear counter before you press the page farm. Start from a spot with no red labels within a few hundred studs, because that’s where the script drops you back when it’s done.

Tested With
DeltaCodexArceus XFluxusPC executors
Script CodeMEDVED Mono V2 (matveiyga)
--[[
    MEDVED MONO V2

    RightShift — скрыть / показать меню
    F6 — автофарм страниц
    F7 — автофарм крейтов

    Если горячие клавиши не работают:
    используй кнопки в меню или попробуй Fn + F6/F7.

    Фармы страниц и крейтов не работают одновременно.
    При остановке фарма персонаж возвращается назад,
    если он всё ещё жив и не сменился.
]]

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

local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local env = getgenv and getgenv() or _G

-- Убираем старые версии.
for _, key in ipairs({
    "MedvedMonoCleanup",
    "MedvedCrateFarmCleanup",
    "MedvedMonoV2Cleanup"
}) do
    if type(env[key]) == "function" then
        pcall(env[key])
        env[key] = nil
    end
end

for _, name in ipairs({
    "MedvedMonoV1",
    "MedvedCrateFarmGui",
    "MedvedMonoV2"
}) do
    local old = playerGui:FindFirstChild(name)
    if old then
        old:Destroy()
    end
end

local alive = true
local connections = {}
local visuals = {}

local settings = {
    bearESP = true,
    friendlyESP = true,
    trackers = true,
    range = 700
}

local colors = {
    background = Color3.fromRGB(13, 15, 19),
    panel = Color3.fromRGB(23, 27, 34),
    button = Color3.fromRGB(34, 39, 48),
    hover = Color3.fromRGB(48, 55, 66),
    text = Color3.fromRGB(240, 244, 250),
    muted = Color3.fromRGB(155, 165, 180),
    hostile = Color3.fromRGB(255, 115, 115),
    friendly = Color3.fromRGB(125, 235, 160),
    accent = Color3.fromRGB(115, 185, 255),
    warning = Color3.fromRGB(255, 195, 105)
}

local function connect(signal, callback)
    local connection = signal:Connect(callback)
    table.insert(connections, connection)
    return connection
end

local function corner(parent, radius)
    local item = Instance.new("UICorner")
    item.CornerRadius = UDim.new(0, radius or 8)
    item.Parent = parent
end

local function stroke(parent, color, transparency)
    local item = Instance.new("UIStroke")
    item.Color = color
    item.Transparency = transparency or 0
    item.Thickness = 1
    item.Parent = parent
end

local function toggleText(name, value)
    return name .. ": " .. (value and "ВКЛ" or "ВЫКЛ")
end

-- ==========================================
-- ИНТЕРФЕЙС
-- ==========================================

local screen = Instance.new("ScreenGui")
screen.Name = "MedvedMonoV2"
screen.ResetOnSpawn = false
screen.IgnoreGuiInset = true
screen.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
screen.Parent = playerGui

local visualFolder = Instance.new("Folder")
visualFolder.Name = "BearVisuals"
visualFolder.Parent = screen

local lineFolder = Instance.new("Folder")
lineFolder.Name = "TrackerLines"
lineFolder.Parent = screen

local main = Instance.new("Frame")
main.Name = "Main"
main.Size = UDim2.fromOffset(340, 450)
main.Position = UDim2.new(0, 35, 0.5, -225)
main.BackgroundColor3 = colors.background
main.BorderSizePixel = 0
main.ClipsDescendants = true
main.Parent = screen
corner(main, 12)
stroke(main, colors.accent, 0.55)

local header = Instance.new("Frame")
header.Size = UDim2.new(1, 0, 0, 58)
header.BackgroundColor3 = colors.panel
header.BorderSizePixel = 0
header.Active = true
header.Parent = main

local title = Instance.new("TextLabel")
title.Position = UDim2.fromOffset(12, 5)
title.Size = UDim2.new(1, -70, 0, 25)
title.BackgroundTransparency = 1
title.Text = "MEDVED / MONO V2"
title.TextColor3 = colors.text
title.TextSize = 16
title.Font = Enum.Font.GothamBold
title.TextXAlignment = Enum.TextXAlignment.Left
title.Parent = header

local subtitle = Instance.new("TextLabel")
subtitle.Position = UDim2.fromOffset(12, 30)
subtitle.Size = UDim2.new(1, -70, 0, 18)
subtitle.BackgroundTransparency = 1
subtitle.Text = "F6: страницы • F7: крейты"
subtitle.TextColor3 = colors.muted
subtitle.TextSize = 10
subtitle.Font = Enum.Font.Gotham
subtitle.TextXAlignment = Enum.TextXAlignment.Left
subtitle.Parent = header

local hideButton = Instance.new("TextButton")
hideButton.Position = UDim2.new(1, -42, 0, 10)
hideButton.Size = UDim2.fromOffset(30, 30)
hideButton.BackgroundColor3 = colors.button
hideButton.BorderSizePixel = 0
hideButton.Text = "−"
hideButton.TextColor3 = colors.text
hideButton.TextSize = 20
hideButton.Font = Enum.Font.GothamBold
hideButton.Parent = header
corner(hideButton, 7)

local showButton = Instance.new("TextButton")
showButton.Name = "ShowMenu"
showButton.Position = UDim2.fromOffset(15, 120)
showButton.Size = UDim2.fromOffset(72, 34)
showButton.BackgroundColor3 = colors.panel
showButton.BorderSizePixel = 0
showButton.Text = "MONO"
showButton.TextColor3 = colors.accent
showButton.TextSize = 12
showButton.Font = Enum.Font.GothamBold
showButton.Visible = false
showButton.Parent = screen
corner(showButton, 8)
stroke(showButton, colors.accent, 0.45)

connect(hideButton.MouseButton1Click, function()
    main.Visible = false
    showButton.Visible = true
end)

connect(showButton.MouseButton1Click, function()
    main.Visible = true
    showButton.Visible = false
end)

local scroll = Instance.new("ScrollingFrame")
scroll.Name = "Content"
scroll.Position = UDim2.fromOffset(10, 66)
scroll.Size = UDim2.new(1, -20, 1, -76)
scroll.BackgroundTransparency = 1
scroll.BorderSizePixel = 0
scroll.ScrollBarThickness = 3
scroll.ScrollBarImageColor3 = colors.accent
scroll.CanvasSize = UDim2.fromOffset(0, 0)
scroll.AutomaticCanvasSize = Enum.AutomaticSize.Y
scroll.Parent = main

local layout = Instance.new("UIListLayout")
layout.SortOrder = Enum.SortOrder.LayoutOrder
layout.Padding = UDim.new(0, 6)
layout.Parent = scroll

local padding = Instance.new("UIPadding")
padding.PaddingRight = UDim.new(0, 5)
padding.PaddingBottom = UDim.new(0, 8)
padding.Parent = scroll

local order = 0
local function nextOrder()
    order += 1
    return order
end

local function makeLabel(text, color)
    local label = Instance.new("TextLabel")
    label.LayoutOrder = nextOrder()
    label.Size = UDim2.new(1, 0, 0, 30)
    label.BackgroundColor3 = colors.panel
    label.BorderSizePixel = 0
    label.Text = text
    label.TextColor3 = color or colors.muted
    label.TextSize = 11
    label.Font = Enum.Font.GothamMedium
    label.TextWrapped = true
    label.Parent = scroll
    corner(label, 7)
    return label
end

local function makeButton(text, callback)
    local button = Instance.new("TextButton")
    button.LayoutOrder = nextOrder()
    button.Size = UDim2.new(1, 0, 0, 32)
    button.BackgroundColor3 = colors.button
    button.BorderSizePixel = 0
    button.Text = text
    button.TextColor3 = colors.text
    button.TextSize = 12
    button.Font = Enum.Font.GothamMedium
    button.AutoButtonColor = false
    button.Parent = scroll
    corner(button, 7)

    connect(button.MouseEnter, function()
        button.BackgroundColor3 = colors.hover
    end)

    connect(button.MouseLeave, function()
        button.BackgroundColor3 = colors.button
    end)

    connect(button.MouseButton1Click, function()
        if alive then
            callback(button)
        end
    end)

    return button
end

local bearStatus = makeLabel("Медведи: поиск...")
local farmStatus = makeLabel("Фарм: выключен")

makeButton(toggleText("ESP медведей", settings.bearESP), function(button)
    settings.bearESP = not settings.bearESP
    button.Text = toggleText("ESP медведей", settings.bearESP)
end)

makeButton(toggleText("Дружелюбные медведи", settings.friendlyESP), function(button)
    settings.friendlyESP = not settings.friendlyESP
    button.Text = toggleText("Дружелюбные медведи", settings.friendlyESP)
end)

makeButton(toggleText("Линии-трекеры", settings.trackers), function(button)
    settings.trackers = not settings.trackers
    button.Text = toggleText("Линии-трекеры", settings.trackers)
end)

local rangeRow = Instance.new("Frame")
rangeRow.LayoutOrder = nextOrder()
rangeRow.Size = UDim2.new(1, 0, 0, 32)
rangeRow.BackgroundTransparency = 1
rangeRow.Parent = scroll

local function rangeButton(text, position)
    local button = Instance.new("TextButton")
    button.Size = UDim2.fromOffset(38, 32)
    button.Position = position
    button.BackgroundColor3 = colors.button
    button.BorderSizePixel = 0
    button.Text = text
    button.TextColor3 = colors.text
    button.TextSize = 16
    button.Font = Enum.Font.GothamBold
    button.Parent = rangeRow
    corner(button, 7)
    return button
end

local minus = rangeButton("−", UDim2.fromOffset(0, 0))
local plus = rangeButton("+", UDim2.new(1, -38, 0, 0))

local rangeLabel = Instance.new("TextLabel")
rangeLabel.Position = UDim2.fromOffset(44, 0)
rangeLabel.Size = UDim2.new(1, -88, 1, 0)
rangeLabel.BackgroundColor3 = colors.panel
rangeLabel.BorderSizePixel = 0
rangeLabel.TextColor3 = colors.text
rangeLabel.TextSize = 11
rangeLabel.Font = Enum.Font.GothamMedium
rangeLabel.Parent = rangeRow
corner(rangeLabel, 7)

local function refreshRange()
    rangeLabel.Text = "Дальность: " .. settings.range .. " / 700 studs"
end

refreshRange()

connect(minus.MouseButton1Click, function()
    settings.range = math.clamp(settings.range - 100, 100, 700)
    refreshRange()
end)

connect(plus.MouseButton1Click, function()
    settings.range = math.clamp(settings.range + 100, 100, 700)
    refreshRange()
end)

local pageButton
local crateButton
local toggleFarm
local cleanup

pageButton = makeButton("Автофарм страниц [F6]: ВЫКЛ", function()
    toggleFarm("pages")
end)

crateButton = makeButton("Автофарм крейтов [F7]: ВЫКЛ", function()
    toggleFarm("crates")
end)

local hint = makeLabel(
    "Фармы работают по одному. Остановка — той же кнопкой.",
    colors.warning
)
hint.TextSize = 10

local stopButton = makeButton("ВЫКЛЮЧИТЬ СКРИПТ", function()
    cleanup()
end)
stopButton.TextColor3 = colors.hostile

-- Перетаскивание меню.
local dragging = false
local dragInput
local dragStart
local startPosition

connect(header.InputBegan, function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1
        or input.UserInputType == Enum.UserInputType.Touch then

        dragging = true
        dragStart = input.Position
        startPosition = main.Position

        if input.UserInputType == Enum.UserInputType.Touch then
            dragInput = input
        end
    end
end)

connect(header.InputChanged, function(input)
    if input.UserInputType == Enum.UserInputType.MouseMovement then
        dragInput = input
    end
end)

connect(UIS.InputChanged, function(input)
    if dragging and input == dragInput and dragStart and startPosition then
        local delta = input.Position - dragStart

        main.Position = UDim2.new(
            startPosition.X.Scale,
            startPosition.X.Offset + delta.X,
            startPosition.Y.Scale,
            startPosition.Y.Offset + delta.Y
        )
    end
end)

connect(UIS.InputEnded, function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1
        or input.UserInputType == Enum.UserInputType.Touch then
        dragging = false
    end
end)

-- ==========================================
-- ESP
-- ==========================================

local function getRoot(model)
    if not model or not model:IsA("Model") then
        return nil
    end

    local root = model:FindFirstChild("HumanoidRootPart")
        or model:FindFirstChild("RootPart")
        or model.PrimaryPart

    if root and root:IsA("BasePart") then
        return root
    end

    return nil
end

local function destroyVisual(visual)
    if visual.billboard then visual.billboard:Destroy() end
    if visual.line then visual.line:Destroy() end
end

local function clearVisuals()
    for model, visual in pairs(visuals) do
        destroyVisual(visual)
        visuals[model] = nil
    end
end

local function createVisual(root, color)
    local billboard = Instance.new("BillboardGui")
    billboard.Name = "BearLabel"
    billboard.Adornee = root
    billboard.Size = UDim2.fromOffset(180, 44)
    billboard.StudsOffset = Vector3.new(0, 3, 0)
    billboard.AlwaysOnTop = true
    billboard.MaxDistance = 700
    billboard.Parent = visualFolder

    local label = Instance.new("TextLabel")
    label.Size = UDim2.fromScale(1, 1)
    label.BackgroundTransparency = 1
    label.TextColor3 = color
    label.TextStrokeColor3 = Color3.new(0, 0, 0)
    label.TextStrokeTransparency = 0
    label.TextSize = 13
    label.Font = Enum.Font.GothamBold
    label.TextWrapped = true
    label.Parent = billboard

    local line = Instance.new("Frame")
    line.Name = "BearTracker"
    line.AnchorPoint = Vector2.new(0.5, 0.5)
    line.BorderSizePixel = 0
    line.BackgroundColor3 = color
    line.Visible = false
    line.Parent = lineFolder

    return {
        root = root,
        billboard = billboard,
        label = label,
        line = line
    }
end

local function updateBears()
    local myRoot = getRoot(player.Character)

    if not myRoot then
        clearVisuals()
        bearStatus.Text = "Медведи: ожидание персонажа"
        return
    end

    local wanted = {}
    local hostileCount = 0
    local friendlyCount = 0

    local function scan(folderName, enabled, friendly)
        if not enabled then return end

        local folder = Workspace:FindFirstChild(folderName)
        if not folder then return end

        for _, model in ipairs(folder:GetChildren()) do
            if model:IsA("Model") and model ~= player.Character then
                local root = getRoot(model)
                local humanoid = model:FindFirstChildOfClass("Humanoid")

                -- У некоторых типов Humanoid отсутствует.
                if root and (not humanoid or humanoid.Health > 0) then
                    local distance = (root.Position - myRoot.Position).Magnitude

                    if distance <= settings.range then
                        wanted[model] = true

                        if friendly then
                            friendlyCount += 1
                        else
                            hostileCount += 1
                        end

                        local color = friendly and colors.friendly or colors.hostile
                        local visual = visuals[model]

                        if visual and visual.root ~= root then
                            destroyVisual(visual)
                            visuals[model] = nil
                            visual = nil
                        end

                        if not visual then
                            visual = createVisual(root, color)
                            visuals[model] = visual
                        end

                        visual.label.TextColor3 = color
                        visual.line.BackgroundColor3 = color
                        visual.billboard.MaxDistance = settings.range

                        local name = model.Name
                        local bearId = model:GetAttribute("BearID")

                        if type(bearId) == "string"
                            and bearId ~= ""
                            and bearId ~= name then
                            name = name .. " [" .. bearId .. "]"
                        end

                        if friendly then
                            name = "ДРУЖЕЛЮБНЫЙ: " .. name
                        end

                        visual.label.Text = name
                            .. "\n" .. math.floor(distance) .. " studs"
                    end
                end
            end
        end
    end

    scan("Bears", settings.bearESP, false)
    scan("FriendlyBears", settings.friendlyESP, true)

    for model, visual in pairs(visuals) do
        if not wanted[model] then
            destroyVisual(visual)
            visuals[model] = nil
        end
    end

    bearStatus.Text = "Медведи: " .. hostileCount
        .. " | Дружелюбные: " .. friendlyCount
end

local function updateLines()
    local camera = Workspace.CurrentCamera

    for _, visual in pairs(visuals) do
        local line = visual.line
        line.Visible = false

        if settings.trackers
            and camera
            and visual.root
            and visual.root:IsDescendantOf(Workspace) then

            local point, onScreen = camera:WorldToViewportPoint(
                visual.root.Position
            )

            if onScreen and point.Z > 0 then
                local viewport = camera.ViewportSize
                local startPoint = Vector2.new(viewport.X / 2, viewport.Y - 20)
                local endPoint = Vector2.new(point.X, point.Y)
                local delta = endPoint - startPoint
                local middle = (startPoint + endPoint) / 2

                line.Size = UDim2.fromOffset(delta.Magnitude, 2)
                line.Position = UDim2.fromOffset(middle.X, middle.Y)
                line.Rotation = math.deg(math.atan2(delta.Y, delta.X))
                line.Visible = true
            end
        end
    end
end

-- ==========================================
-- ОБЩЕЕ УПРАВЛЕНИЕ ФАРМОМ
-- ==========================================

local farmMode = nil
local farmBusy = false
local farmToken = 0
local farmContext = nil

local function validCharacter(character, humanoid, root)
    return character
        and humanoid
        and root
        and player.Character == character
        and character:IsDescendantOf(Workspace)
        and humanoid.Parent ~= nil
        and humanoid.Health > 0
        and root:IsDescendantOf(character)
end

local function returnToStart(context)
    if not context or context.returned then return end
    context.returned = true

    if validCharacter(context.character, context.humanoid, context.root) then
        local ok, err = pcall(function()
            context.character:PivotTo(context.original)
        end)

        if not ok then
            warn("[MEDVED] Ошибка возврата:", err)
        end
    else
        print("[MEDVED] Возврат пропущен: персонаж умер или сменился")
    end
end

local function isActive(token)
    return alive and farmMode ~= nil and farmToken == token
end

local function waitActive(seconds, token)
    local deadline = os.clock() + seconds

    while isActive(token) and os.clock() < deadline do
        task.wait(0.05)
    end

    return isActive(token)
end

local function refreshFarmButtons()
    pageButton.Text = toggleText("Автофарм страниц [F6]", farmMode == "pages")
    crateButton.Text = toggleText("Автофарм крейтов [F7]", farmMode == "crates")
end

local function getNearestPage(root, attempted)
    local folder = Workspace:FindFirstChild("Pages")
    if not folder then
        return nil, nil, "Папка Pages не найдена"
    end

    local selected, selectedPrompt, nearestDistance

    for _, page in ipairs(folder:GetChildren()) do
        if page:IsA("BasePart") and not attempted[page] then
            local prompt = page:FindFirstChildWhichIsA("ProximityPrompt", true)

            if prompt and prompt.Enabled then
                local distance = (page.Position - root.Position).Magnitude

                if not nearestDistance or distance < nearestDistance then
                    selected = page
                    selectedPrompt = prompt
                    nearestDistance = distance
                end
            end
        end
    end

    return selected, selectedPrompt
end

local function getNearestCrate(root, attempted)
    local interactables = Workspace:FindFirstChild("Interactables")
    local folder = interactables and interactables:FindFirstChild("Crates")

    if not folder then
        return nil, nil, nil, "Папка Crates не найдена"
    end

    local selected, selectedPart, selectedPrompt, nearestDistance

    for _, model in ipairs(folder:GetChildren()) do
        if model:IsA("Model")
            and not attempted[model]
            and model:GetAttribute("Collected") ~= true then

            local part = model:FindFirstChild("Crate")
            local prompt = part and part:FindFirstChild("CratePrompt")

            if part and part:IsA("BasePart")
                and prompt and prompt:IsA("ProximityPrompt")
                and prompt.Enabled then

                local distance = (part.Position - root.Position).Magnitude

                if not nearestDistance or distance < nearestDistance then
                    selected = model
                    selectedPart = part
                    selectedPrompt = prompt
                    nearestDistance = distance
                end
            end
        end
    end

    return selected, selectedPart, selectedPrompt
end

local function runPages(context, token)
    local attempted = {}
    local attempts = 0
    local confirmed = 0
    local reason = "доступных страниц больше нет"

    while isActive(token) do
        if not validCharacter(context.character, context.humanoid, context.root) then
            reason = "персонаж умер или сменился"
            break
        end

        local page, prompt, err = getNearestPage(context.root, attempted)

        if err then
            reason = err
            break
        end

        if not page then break end

        attempted[page] = true
        attempts += 1
        farmStatus.Text = "Страница: " .. page.Name .. " | попытка " .. attempts

        local ok, teleportError = pcall(function()
            context.character:PivotTo(page.CFrame * CFrame.new(0, 3, 0))
        end)

        if not ok then
            warn("[MEDVED] Телепорт к странице:", teleportError)
        elseif waitActive(1, token)
            and validCharacter(context.character, context.humanoid, context.root)
            and page:IsDescendantOf(Workspace)
            and prompt.Parent
            and prompt.Enabled then

            local fired, fireError = pcall(function()
                fireproximityprompt(prompt)
            end)

            if not fired then
                warn("[MEDVED] Сбор страницы:", fireError)
            end

            if not waitActive(1.5, token) then
                reason = "остановлен"
                break
            end

            if not page:IsDescendantOf(Workspace)
                or not prompt.Parent
                or not prompt.Enabled then
                confirmed += 1
            end
        end
    end

    return reason, "Страницы: " .. confirmed .. "/" .. attempts
end

local function runCrates(context, token)
    local attempted = {}
    local attempts = 0
    local opened = 0
    local itemAttempts = 0
    local reason = "доступных крейтов больше нет"

    while isActive(token) do
        if not validCharacter(context.character, context.humanoid, context.root) then
            reason = "персонаж умер или сменился"
            break
        end

        local crate, cratePart, prompt, err =
            getNearestCrate(context.root, attempted)

        if err then
            reason = err
            break
        end

        if not crate then break end

        attempted[crate] = true
        attempts += 1
        farmStatus.Text = "Крейт: " .. crate.Name .. " | попытка " .. attempts

        local ok, teleportError = pcall(function()
            context.character:PivotTo(cratePart.CFrame * CFrame.new(0, 3, 0))
        end)

        if not ok then
            warn("[MEDVED] Телепорт к крейту:", teleportError)
        elseif waitActive(0.7, token)
            and validCharacter(context.character, context.humanoid, context.root)
            and crate:IsDescendantOf(Workspace)
            and prompt.Parent
            and prompt.Enabled then

            local fired, fireError = pcall(function()
                fireproximityprompt(prompt)
            end)

            if not fired then
                warn("[MEDVED] Открытие крейта:", fireError)
            end

            if not waitActive(1.5, token) then
                reason = "остановлен"
                break
            end

            if crate:GetAttribute("Collected") == true
                or not prompt.Parent
                or not prompt.Enabled then
                opened += 1
            end

            if crate:IsDescendantOf(Workspace) then
                for _, obj in ipairs(crate:GetDescendants()) do
                    if not isActive(token)
                        or not validCharacter(
                            context.character,
                            context.humanoid,
                            context.root
                        ) then
                        break
                    end

                    if obj:IsA("ProximityPrompt")
                        and obj.Name == "ItemPrompt"
                        and obj.Enabled then

                        itemAttempts += 1
                        print("[MEDVED] Предмет:", obj.ObjectText)

                        local itemOk, itemError = pcall(function()
                            fireproximityprompt(obj)
                        end)

                        if not itemOk then
                            warn("[MEDVED] Сбор предмета:", itemError)
                        end

                        if not waitActive(0.35, token) then
                            reason = "остановлен"
                            break
                        end
                    end
                end
            end
        end
    end

    return reason, "Крейты: " .. opened .. "/" .. attempts
        .. " | предметы: " .. itemAttempts .. " попыток"
end

local function runFarm(mode, token)
    local character = player.Character
    local root = character and character:FindFirstChild("HumanoidRootPart")
    local humanoid = character and character:FindFirstChildOfClass("Humanoid")

    if not validCharacter(character, humanoid, root) then
        farmBusy = false
        farmMode = nil

        if alive then
            refreshFarmButtons()
            farmStatus.Text = "Фарм: живой персонаж не найден"
        end
        return
    end

    local context = {
        character = character,
        root = root,
        humanoid = humanoid,
        original = character:GetPivot(),
        returned = false
    }

    farmContext = context

    local ok, reason, result = xpcall(function()
        if mode == "pages" then
            return runPages(context, token)
        else
            return runCrates(context, token)
        end
    end, debug.traceback)

    returnToStart(context)

    if farmContext == context then
        farmContext = nil
    end

    farmBusy = false

    if farmToken == token then
        farmMode = nil
    end

    if not ok then
        warn("[MEDVED] Ошибка фарма:", reason)
        result = "Фарм: ошибка, смотри консоль"
    else
        print("[MEDVED] Фарм завершён:", reason, result)
    end

    if alive then
        refreshFarmButtons()
        farmStatus.Text = result or "Фарм завершён"
    end
end

toggleFarm = function(mode)
    if farmMode == mode then
        farmMode = nil
        farmToken += 1
        refreshFarmButtons()
        farmStatus.Text = "Остановка и возврат..."
        return
    end

    if farmBusy or farmMode ~= nil then
        farmStatus.Text = "Сначала останови текущий фарм"
        return
    end

    if type(fireproximityprompt) ~= "function" then
        farmStatus.Text = "fireproximityprompt недоступен"
        return
    end

    farmMode = mode
    farmBusy = true
    farmToken += 1

    refreshFarmButtons()
    farmStatus.Text = "Фарм: запуск..."
    task.spawn(runFarm, mode, farmToken)
end

-- ==========================================
-- КЛАВИШИ И ОБНОВЛЕНИЕ
-- ==========================================

-- Не используем processed: игра могла помечать клавиши
-- обработанными. При вводе текста горячие клавиши на паузе.
connect(UIS.InputBegan, function(input)
    if UIS:GetFocusedTextBox() then
        return
    end

    if input.KeyCode == Enum.KeyCode.RightShift then
        main.Visible = not main.Visible
        showButton.Visible = not main.Visible
    elseif input.KeyCode == Enum.KeyCode.F6 then
        toggleFarm("pages")
    elseif input.KeyCode == Enum.KeyCode.F7 then
        toggleFarm("crates")
    end
end)

local elapsed = 0

connect(RunService.Heartbeat, function(dt)
    if not alive then return end

    elapsed += dt
    if elapsed >= 0.5 then
        elapsed = 0
        updateBears()
    end
end)

connect(RunService.RenderStepped, function()
    if alive then
        updateLines()
    end
end)

-- ==========================================
-- ОЧИСТКА
-- ==========================================

cleanup = function()
    if not alive then return end

    farmMode = nil
    farmToken += 1

    -- Возвращаем персонажа сразу, если фарм активен.
    returnToStart(farmContext)
    farmContext = nil

    alive = false

    for _, connection in ipairs(connections) do
        connection:Disconnect()
    end

    clearVisuals()
    screen:Destroy()

    if env.MedvedMonoV2Cleanup == cleanup then
        env.MedvedMonoV2Cleanup = nil
    end

    print("[MEDVED V2] Скрипт выключен.")
end

env.MedvedMonoV2Cleanup = cleanup

updateBears()

print("[MEDVED V2] Загружен.")
print("[MEDVED V2] RightShift — меню | F6 — страницы | F7 — крейты.")
print("[MEDVED V2] Если F-клавиши не срабатывают, попробуй Fn + F6/F7.")
Game pageMEDVED · 1 script on this siteRoblox ›

More MEDVED scripts

See all
Get Delta Script first on GoogleAdd us as a preferred source to see our new scripts in your Google results.
Add Delta Script on Google

Leave a Reply

Your email address will not be published. Required fields are marked *