local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local UserInputService = game:GetService("UserInputService") local TextService = game:GetService("TextService") local RunService = game:GetService("RunService") local player = Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() -- Настройки авто-хила local AUTO_HEAL = false local HEAL_ITEMS = {"Bloodfruit"} local CURRENT_HEAL_ITEM = "Bloodfruit" -- Находим RemoteEvent для использования предметов local eventsFolder = ReplicatedStorage:FindFirstChild("Events") or ReplicatedStorage:FindFirstChild("Remotes") local UseBagItem = eventsFolder and eventsFolder:FindFirstChild("UseBagItem") -- Создаем интерфейс local screenGui = Instance.new("ScreenGui") screenGui.Name = "AutoHealUI" screenGui.Parent = player.PlayerGui screenGui.ResetOnSpawn = false local frame = Instance.new("Frame") frame.Size = UDim2.new(0, 150, 0, 40) frame.Position = UDim2.new(1, -160, 0, 10) frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30) frame.BorderSizePixel = 0 frame.Parent = screenGui local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, 6) corner.Parent = frame local statusText = Instance.new("TextLabel") statusText.Size = UDim2.new(1, 0, 1, 0) statusText.BackgroundTransparency = 1 statusText.Text = "Авто-хил: ВЫКЛ" statusText.TextColor3 = Color3.fromRGB(255, 50, 50) statusText.Font = Enum.Font.GothamBold statusText.TextSize = 14 statusText.Parent = frame -- Функция обновления интерфейса local function updateUI() if AUTO_HEAL then statusText.Text = "Авто-хил: ВКЛ" statusText.TextColor3 = Color3.fromRGB(50, 255, 50) else statusText.Text = "Авто-хил: ВЫКЛ" statusText.TextColor3 = Color3.fromRGB(255, 50, 50) end end -- Функция для проверки, находится ли игрок в чате local function isPlayerTyping() local chatBar = player.PlayerGui:FindFirstChild("Chat") and player.PlayerGui.Chat:FindFirstChild("Frame") and player.PlayerGui.Chat.Frame:FindFirstChild("ChatBarParentFrame") if chatBar then local chatBarBox = chatBar:FindFirstChild("ChatBar") if chatBarBox and chatBarBox:IsA("TextBox") then return chatBarBox:IsFocused() end end return false end -- Функция для использования предмета для лечения local function useHealItem(itemName) if not UseBagItem then return false end local success = pcall(function() UseBagItem:FireServer(itemName) return true end) return success end -- Функция для обновления персонажа local function refreshCharacter() character = player.Character or player.CharacterAdded:Wait() end -- Основная функция авто-хила local function autoHeal() if not AUTO_HEAL or not character or not character:FindFirstChild("Humanoid") then return end local humanoid = character.Humanoid if humanoid.Health < humanoid.MaxHealth and humanoid.Health > 0 then useHealItem(CURRENT_HEAL_ITEM) end end -- Основной цикл хила RunService.Heartbeat:Connect(function() if character and character:FindFirstChild("HumanoidRootPart") and character.Humanoid.Health > 0 then autoHeal() end end) -- Обработка смерти персонажа player.CharacterAdded:Connect(function(newChar) character = newChar end) -- Управление UserInputService.InputBegan:Connect(function(input) -- Пропускаем если игрок в чате if isPlayerTyping() then return end if input.KeyCode == Enum.KeyCode.M then AUTO_HEAL = not AUTO_HEAL updateUI() elseif input.KeyCode == Enum.KeyCode.P then refreshCharacter() end end) -- Инициализация интерфейса updateUI()