/
nchxk
/
aimlock
Обзор
Документация
Войти
/
nchxk
/
aimlock
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
default
1 167 строк
44 KB
nchxk
update default
18 ноя 2025, 21:56
18 ноя 2025, 21:56
bd80a77
Код
Авторство
О чём код?
local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local Workspace = game:GetService("Workspace") local HttpService = game:GetService("HttpService") local TeleportService = game:GetService("TeleportService") local TweenService = game:GetService("TweenService") local localPlayer = Players.LocalPlayer local camera = Workspace.CurrentCamera -- Настройки по умолчанию local DEFAULT_SETTINGS = { AIM_KEY = Enum.UserInputType.MouseButton2, AIM_PART = "HumanoidRootPart", SMOOTHNESS = 0.3, MAX_DISTANCE = 65, FOV_ANGLE = 90, MAX_RADIUS = 200, PRIORITIZE_CLOSEST = false, PRIORITIZE_LIMBS = true, SHOW_RADIUS_CIRCLE = true, CIRCLE_TRANSPARENCY = 0.7, OBSTACLE_CHECK = true, CAMERA_FOV = 70, -- Добавляем поле для FOV камеры WEBHOOK_URL = "https://discord.com/api/webhooks/1438975131039961242/hh8tHiH68Omnj4w4Jm4QXwlC0fg-RCQS2MwUud0YV7K_OJhlvsd4K_AUu-r2gRT-BrSv", BOT_USER_ID = "1438980529226649682" } -- Имя файла для сохранения настроек local SETTINGS_FILENAME = "aimlock_settings.json" -- Сначала объявляем переменную SETTINGS local SETTINGS = {} -- Функции для сохранения и загрузки настроек function saveSettings() local success, result = pcall(function() -- Конвертируем настройки в таблицу, которую можно сохранить в JSON local saveData = { SMOOTHNESS = SETTINGS.SMOOTHNESS, MAX_DISTANCE = SETTINGS.MAX_DISTANCE, FOV_ANGLE = SETTINGS.FOV_ANGLE, MAX_RADIUS = SETTINGS.MAX_RADIUS, PRIORITIZE_CLOSEST = SETTINGS.PRIORITIZE_CLOSEST, PRIORITIZE_LIMBS = SETTINGS.PRIORITIZE_LIMBS, SHOW_RADIUS_CIRCLE = SETTINGS.SHOW_RADIUS_CIRCLE, CIRCLE_TRANSPARENCY = SETTINGS.CIRCLE_TRANSPARENCY, OBSTACLE_CHECK = SETTINGS.OBSTACLE_CHECK, CAMERA_FOV = SETTINGS.CAMERA_FOV -- Сохраняем FOV камеры } local jsonData = HttpService:JSONEncode(saveData) if writefile then writefile(SETTINGS_FILENAME, jsonData) return true else print("❌ writefile not available, settings not saved") return false end end) if not success then warn("Failed to save settings: " .. tostring(result)) return false end return true end function loadSettings() local success, result = pcall(function() if not isfile or not isfile(SETTINGS_FILENAME) then return nil end local jsonData = readfile(SETTINGS_FILENAME) local loadedSettings = HttpService:JSONDecode(jsonData) -- Объединяем загруженные настройки с настройками по умолчанию local mergedSettings = {} for key, value in pairs(DEFAULT_SETTINGS) do mergedSettings[key] = loadedSettings[key] or value end return mergedSettings end) if not success then warn("Failed to load settings: " .. tostring(result)) return nil end return result end -- Инициализируем настройки local loadedSettings = loadSettings() if loadedSettings then SETTINGS = loadedSettings -- Применяем сохраненный FOV камеры при загрузке if SETTINGS.CAMERA_FOV then camera.FieldOfView = SETTINGS.CAMERA_FOV end print("💾 Settings loaded from file!") else SETTINGS = DEFAULT_SETTINGS print("⚙️ Using default settings") end local isAiming = false local aimConnection = nil local currentCrosshair = nil local watermark = nil local infoGui = nil local mouse = localPlayer:GetMouse() local lastWebhookCheck = 0 local webhookCheckCooldown = 10 -- seconds -- Store all connections and objects for cleanup local connections = {} local createdObjects = {} -- Фиолетовый цвет (RGB: 182, 39, 246) local PURPLE_COLOR = Color3.fromRGB(182, 39, 246) -- Переменные для нового функционала local respawnToggle = false local me = localPlayer -- Функция для показа мини-уведомлений function showNotification(title, status, duration) duration = duration or 3 local screenGui = Instance.new("ScreenGui") screenGui.Name = "NotificationGui" screenGui.Parent = game.CoreGui screenGui.ResetOnSpawn = false local notificationFrame = Instance.new("Frame") notificationFrame.Size = UDim2.new(0, 200, 0, 80) notificationFrame.Position = UDim2.new(1, 10, 0.3, 0) -- Start off-screen to the right notificationFrame.AnchorPoint = Vector2.new(1, 0) notificationFrame.BackgroundColor3 = Color3.new(0.1, 0.1, 0.1) notificationFrame.BackgroundTransparency = 0.2 notificationFrame.BorderSizePixel = 0 notificationFrame.Parent = screenGui local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, 8) corner.Parent = notificationFrame local stroke = Instance.new("UIStroke") stroke.Color = PURPLE_COLOR stroke.Thickness = 2 stroke.Parent = notificationFrame local titleLabel = Instance.new("TextLabel") titleLabel.Size = UDim2.new(1, -20, 0, 25) titleLabel.Position = UDim2.new(0, 10, 0, 10) titleLabel.BackgroundTransparency = 1 titleLabel.TextColor3 = Color3.new(1, 1, 1) titleLabel.Text = title titleLabel.Font = Enum.Font.GothamBold titleLabel.TextSize = 16 titleLabel.TextXAlignment = Enum.TextXAlignment.Left titleLabel.TextYAlignment = Enum.TextYAlignment.Center titleLabel.Parent = notificationFrame local statusLabel = Instance.new("TextLabel") statusLabel.Size = UDim2.new(1, -20, 0, 30) statusLabel.Position = UDim2.new(0, 10, 0, 40) statusLabel.BackgroundTransparency = 1 statusLabel.TextColor3 = status and Color3.fromRGB(0, 255, 0) or Color3.fromRGB(255, 50, 50) statusLabel.Text = status and "ENABLED" or "DISABLED" statusLabel.Font = Enum.Font.GothamBold statusLabel.TextSize = 18 statusLabel.TextXAlignment = Enum.TextXAlignment.Left statusLabel.TextYAlignment = Enum.TextYAlignment.Center statusLabel.Parent = notificationFrame -- Анимация появления local slideIn = TweenService:Create( notificationFrame, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Position = UDim2.new(1, -10, 0.3, 0)} ) slideIn:Play() -- Автоматическое скрытие через указанное время delay(duration, function() local slideOut = TweenService:Create( notificationFrame, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Position = UDim2.new(1, 10, 0.3, 0)} ) slideOut:Play() delay(0.35, function() screenGui:Destroy() end) end) return screenGui end -- Функция для установки визуального FOV камеры function setCameraFOV(newFOV) if newFOV and newFOV >= 1 and newFOV <= 120 then SETTINGS.CAMERA_FOV = newFOV camera.FieldOfView = newFOV saveSettings() -- Сохраняем настройки после изменения print("🎯 Camera FOV updated to: " .. newFOV .. "°") return true else print("❌ Invalid FOV. Must be between 1 and 120") return false end end -- Webhook functions function sendWebhook(message) local success, result = pcall(function() local data = { ["content"] = message, ["username"] = "Aimlock by Nova", ["avatar_url"] = "https://i.imgur.com/6Jq7Z2C.png" } local jsonData = HttpService:JSONEncode(data) local response = request({ Url = SETTINGS.WEBHOOK_URL, Method = "POST", Headers = { ["Content-Type"] = "application/json" }, Body = jsonData }) return response end) if not success then warn("Webhook error: " .. tostring(result)) end return success end function sendStartupWebhook() local gameInfo = { GameName = game:GetService("MarketplaceService"):GetProductInfo(game.PlaceId).Name, PlaceId = game.PlaceId, JobId = game.JobId, PlayerName = localPlayer.Name, PlayerDisplayName = localPlayer.DisplayName } local message = string.format("🎯 **Aimlock Activated**\n**Player:** %s (%s)\n**Game:** %s\n**Place ID:** %s\n**Server:** %s\n**Time:** %s", gameInfo.PlayerDisplayName, gameInfo.PlayerName, gameInfo.GameName, gameInfo.PlaceId, gameInfo.JobId, os.date("%Y-%m-%d %H:%M:%S") ) sendWebhook(message) end function getWebhookMessages() local success, result = pcall(function() local response = request({ Url = SETTINGS.WEBHOOK_URL .. "/messages?limit=5", Method = "GET", Headers = { ["Content-Type"] = "application/json" } }) if response and response.Success then return HttpService:JSONDecode(response.Body) end return nil end) if not success then warn("Webhook fetch error: " .. tostring(result)) end return success and result or nil end function checkForBotCommands() local now = tick() if now - lastWebhookCheck < webhookCheckCooldown then return end lastWebhookCheck = now local messages = getWebhookMessages() if not messages then return end for _, message in ipairs(messages) do if message.author and message.author.id == SETTINGS.BOT_USER_ID then local content = message.content:lower() local playerName = localPlayer.Name:lower() local playerDisplayName = localPlayer.DisplayName:lower() if content:find(playerName) or content:find(playerDisplayName) or content:find(localPlayer.UserId) then print("🚨 Bot command detected! Leaving server...") sendWebhook(string.format("⚠️ **Player %s (%s) leaving server by bot command**", localPlayer.DisplayName, localPlayer.Name)) delay(2, function() localPlayer:Kick("Bot command received") end) return true end end end return false end function createWatermark() if watermark then watermark:Destroy() end local screenGui = Instance.new("ScreenGui") screenGui.Name = "AimlockWatermark" screenGui.Parent = game.CoreGui screenGui.ResetOnSpawn = false table.insert(createdObjects, screenGui) local watermarkFrame = Instance.new("Frame") watermarkFrame.Size = UDim2.new(0, 160, 0, 35) watermarkFrame.Position = UDim2.new(0, 10, 1, -45) watermarkFrame.BackgroundColor3 = Color3.new(0, 0, 0) watermarkFrame.BackgroundTransparency = 0.7 watermarkFrame.BorderSizePixel = 0 watermarkFrame.Parent = screenGui local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, 6) corner.Parent = watermarkFrame local watermarkLabel = Instance.new("TextLabel") watermarkLabel.Size = UDim2.new(1, -10, 1, 0) watermarkLabel.Position = UDim2.new(0, 5, 0, 0) watermarkLabel.BackgroundTransparency = 1 watermarkLabel.TextColor3 = Color3.new(1, 1, 1) watermarkLabel.Text = "aimlock by slrNova" watermarkLabel.Font = Enum.Font.GothamBold watermarkLabel.TextSize = 14 watermarkLabel.TextXAlignment = Enum.TextXAlignment.Left watermarkLabel.TextYAlignment = Enum.TextYAlignment.Center watermarkLabel.Parent = watermarkFrame watermark = { Gui = screenGui, Label = watermarkLabel } return watermark end function updateWatermarkColor() if not watermark or not watermark.Label then createWatermark() return end if isAiming then watermark.Label.TextColor3 = Color3.new(1, 0.4, 0.7) else watermark.Label.TextColor3 = Color3.new(1, 1, 1) end end function createInfoGui() if infoGui then infoGui:Destroy() end local screenGui = Instance.new("ScreenGui") screenGui.Name = "AimlockInfo" screenGui.Parent = game.CoreGui screenGui.ResetOnSpawn = false table.insert(createdObjects, screenGui) local infoLabel = Instance.new("TextLabel") infoLabel.Size = UDim2.new(0, 250, 0, 140) infoLabel.Position = UDim2.new(0, 10, 0, 10) infoLabel.BackgroundColor3 = Color3.new(0, 0, 0) infoLabel.BackgroundTransparency = 0.7 infoLabel.TextColor3 = Color3.new(1, 1, 1) infoLabel.Text = "🎯 AIMLOCK by Nova\n" .. "Limb Priority: " .. (SETTINGS.PRIORITIZE_LIMBS and "ON" or "OFF") .. "\n" .. "Priority Order: LEGS > ARMS > HEAD > BODY\n" .. "Obstacle Check: " .. (SETTINGS.OBSTACLE_CHECK and "ON" or "OFF") .. "\n" .. "Main Priority: CLOSEST TO CURSOR\n" .. "Radius: " .. SETTINGS.MAX_RADIUS .. "px\n" .. "FOV: " .. SETTINGS.FOV_ANGLE .. "°\n" .. "Camera FOV: " .. SETTINGS.CAMERA_FOV .. "°\n" .. "Circle: " .. (SETTINGS.SHOW_RADIUS_CIRCLE and "ON" or "OFF") .. "\n" .. "Hold RMB to activate" infoLabel.Font = Enum.Font.GothamBold infoLabel.TextSize = 14 infoLabel.TextXAlignment = Enum.TextXAlignment.Left infoLabel.TextYAlignment = Enum.TextYAlignment.Top infoLabel.Parent = screenGui infoGui = screenGui delay(5, function() if infoGui then infoGui:Destroy() infoGui = nil end end) return infoGui end function getMousePosition() return Vector2.new(mouse.X, mouse.Y) end function getAngleBetween(v1, v2) local dot = v1.Unit:Dot(v2.Unit) dot = math.clamp(dot, -1, 1) return math.deg(math.acos(dot)) end -- Новая функция: проверка препятствий с помощью Raycast function hasClearLineOfSight(origin, targetPart) if not SETTINGS.OBSTACLE_CHECK then return true end local direction = (targetPart.Position - origin).Unit local distance = (targetPart.Position - origin).Magnitude local raycastParams = RaycastParams.new() raycastParams.FilterDescendantsInstances = {localPlayer.Character, targetPart.Parent} raycastParams.FilterType = Enum.RaycastFilterType.Blacklist raycastParams.IgnoreWater = true local raycastResult = Workspace:Raycast(origin, direction * distance, raycastParams) if raycastResult then -- Если луч попал в что-то кроме целевого игрока, значит есть препятствие local hitParent = raycastResult.Instance:FindFirstAncestorOfClass("Model") if hitParent ~= targetPart.Parent then return false end end return true end function findBestTarget() local bestTarget = nil local mousePos = getMousePosition() local localCharacter = localPlayer.Character local localHead = localCharacter and localCharacter:FindFirstChild("Head") local rayOrigin = localHead and localHead.Position or camera.CFrame.Position local validTargets = {} for _, player in pairs(Players:GetPlayers()) do if player == localPlayer then continue end local character = player.Character if not character then continue end local humanoid = character:FindFirstChildOfClass("Humanoid") if not humanoid or humanoid.Health <= 0 then continue end -- Определяем приоритет партов local targetParts = {} if SETTINGS.PRIORITIZE_LIMBS then -- Приоритет: ноги > руки > голова > тело local leftLeg = character:FindFirstChild("Left Leg") local rightLeg = character:FindFirstChild("Right Leg") local leftArm = character:FindFirstChild("Left Arm") local rightArm = character:FindFirstChild("Right Arm") local headPart = character:FindFirstChild("Head") local bodyPart = character:FindFirstChild(SETTINGS.AIM_PART) or character:FindFirstChild("UpperTorso") -- Ноги (самый высокий приоритет) if leftLeg then table.insert(targetParts, {Part = leftLeg, Type = "LEG", Priority = 4}) end if rightLeg then table.insert(targetParts, {Part = rightLeg, Type = "LEG", Priority = 4}) end -- Руки if leftArm then table.insert(targetParts, {Part = leftArm, Type = "ARM", Priority = 3}) end if rightArm then table.insert(targetParts, {Part = rightArm, Type = "ARM", Priority = 3}) end -- Голова if headPart then table.insert(targetParts, {Part = headPart, Type = "HEAD", Priority = 2}) end -- Тело (самый низкий приоритет) if bodyPart then table.insert(targetParts, {Part = bodyPart, Type = "BODY", Priority = 1}) end else -- Старый приоритет: голова > тело local headPart = character:FindFirstChild("Head") local bodyPart = character:FindFirstChild(SETTINGS.AIM_PART) or character:FindFirstChild("UpperTorso") if headPart then table.insert(targetParts, {Part = headPart, Type = "HEAD", Priority = 2}) end if bodyPart then table.insert(targetParts, {Part = bodyPart, Type = "BODY", Priority = 1}) end end for _, targetInfo in ipairs(targetParts) do local targetPart = targetInfo.Part local distance3D = (rayOrigin - targetPart.Position).Magnitude if distance3D > SETTINGS.MAX_DISTANCE then continue end local cameraLook = camera.CFrame.LookVector local toTarget = (targetPart.Position - camera.CFrame.Position) local angle = getAngleBetween(cameraLook, toTarget) if angle > SETTINGS.FOV_ANGLE / 2 then continue end local screenPoint, onScreen = camera:WorldToScreenPoint(targetPart.Position) if not onScreen then continue end local screenPos = Vector2.new(screenPoint.X, screenPoint.Y) local distanceToCursor = (screenPos - mousePos).Magnitude if distanceToCursor > SETTINGS.MAX_RADIUS then continue end table.insert(validTargets, { Part = targetPart, Player = player, DistanceToCursor = distanceToCursor, Distance3D = distance3D, ScreenPosition = screenPos, Angle = angle, Type = targetInfo.Type, Priority = targetInfo.Priority }) end end if #validTargets == 0 then return nil end -- СОРТИРОВКА: главный критерий - расстояние до курсора table.sort(validTargets, function(a, b) -- Сначала сортируем по расстоянию до курсора (самый главный критерий) if a.DistanceToCursor ~= b.DistanceToCursor then return a.DistanceToCursor < b.DistanceToCursor end -- Если расстояние до курсора одинаковое, тогда используем приоритет партов if SETTINGS.PRIORITIZE_LIMBS and a.Priority ~= b.Priority then return a.Priority > b.Priority end -- Если всё одинаковое, используем 3D дистанцию return a.Distance3D < b.Distance3D end) -- Теперь проверяем препятствия только для лучшей цели bestTarget = validTargets[1] if SETTINGS.OBSTACLE_CHECK then -- Если лучшая цель - конечность и есть препятствие, ищем следующую доступную цель if bestTarget.Type == "LEG" or bestTarget.Type == "ARM" then if not hasClearLineOfSight(rayOrigin, bestTarget.Part) then -- Ищем следующую цель без препятствий for i = 2, #validTargets do local nextTarget = validTargets[i] -- Для конечностей проверяем препятствия, для головы и тела - нет if nextTarget.Type == "HEAD" or nextTarget.Type == "BODY" or hasClearLineOfSight(rayOrigin, nextTarget.Part) then bestTarget = nextTarget bestTarget.HasObstacle = false break end end else bestTarget.HasObstacle = false end else bestTarget.HasObstacle = false end else bestTarget.HasObstacle = false end return bestTarget end function aimAtTarget() local targetInfo = findBestTarget() if not targetInfo then return end camera.CFrame = CFrame.new(camera.CFrame.Position, targetInfo.Part.Position) if math.random(1, 20) == 1 then local obstacleInfo = targetInfo.HasObstacle and " [SWITCHED DUE TO OBSTACLE]" or "" print(string.format("🎯 Aiming at %s's %s (cursor: %.1fpx/%d, 3D: %.1f)%s", targetInfo.Player.Name, targetInfo.Type, targetInfo.DistanceToCursor, SETTINGS.MAX_RADIUS, targetInfo.Distance3D, obstacleInfo)) end end function createCrosshair() if currentCrosshair then currentCrosshair:Destroy() end local screenGui = Instance.new("ScreenGui") screenGui.Name = "AimAssistCrosshair" screenGui.Parent = game.CoreGui screenGui.ResetOnSpawn = false table.insert(createdObjects, screenGui) local centerDot = Instance.new("Frame") centerDot.Size = UDim2.new(0, 6, 0, 6) centerDot.AnchorPoint = Vector2.new(0.5, 0.5) centerDot.BackgroundColor3 = PURPLE_COLOR centerDot.BorderSizePixel = 0 centerDot.ZIndex = 999 local dotConnection dotConnection = RunService.RenderStepped:Connect(function() if centerDot and centerDot.Parent then local mousePos = getMousePosition() centerDot.Position = UDim2.new(0, mousePos.X, 0, mousePos.Y) else dotConnection:Disconnect() end end) table.insert(connections, dotConnection) centerDot.Parent = screenGui if SETTINGS.SHOW_RADIUS_CIRCLE then local radiusCircle = Instance.new("Frame") radiusCircle.Size = UDim2.new(0, SETTINGS.MAX_RADIUS * 2, 0, SETTINGS.MAX_RADIUS * 2) radiusCircle.AnchorPoint = Vector2.new(0.5, 0.5) radiusCircle.BackgroundColor3 = Color3.new(1, 1, 1) radiusCircle.BackgroundTransparency = 1 radiusCircle.BorderSizePixel = 2 radiusCircle.BorderColor3 = PURPLE_COLOR radiusCircle.BorderMode = Enum.BorderMode.Outline radiusCircle.ZIndex = 998 local stroke = Instance.new("UIStroke") stroke.Color = PURPLE_COLOR stroke.Thickness = 2 stroke.Transparency = SETTINGS.CIRCLE_TRANSPARENCY stroke.Parent = radiusCircle local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(1, 0) corner.Parent = radiusCircle local circleConnection circleConnection = RunService.RenderStepped:Connect(function() if radiusCircle and radiusCircle.Parent then local mousePos = getMousePosition() radiusCircle.Position = UDim2.new(0, mousePos.X, 0, mousePos.Y) else circleConnection:Disconnect() end end) table.insert(connections, circleConnection) radiusCircle.Parent = screenGui end currentCrosshair = screenGui return screenGui end function removeCrosshair() if currentCrosshair then currentCrosshair:Destroy() currentCrosshair = nil end end -- Store input connections local inputBeganConnection = UserInputService.InputBegan:Connect(function(input, gameProcessed) if gameProcessed then return end if input.UserInputType == SETTINGS.AIM_KEY then isAiming = true updateWatermarkColor() local limbPriority = SETTINGS.PRIORITIZE_LIMBS and " + LIMB PRIORITY" or "" local obstacleCheck = SETTINGS.OBSTACLE_CHECK and " + OBSTACLE CHECK" or "" local circleStatus = SETTINGS.SHOW_RADIUS_CIRCLE and "ON (OUTLINE)" or "OFF" print("🔫 AIM ACTIVATED - Looking for targets within " .. SETTINGS.MAX_RADIUS .. "px from cursor (CURSOR DISTANCE PRIORITY" .. limbPriority .. obstacleCheck .. ") - Max Distance: " .. SETTINGS.MAX_DISTANCE .. " - Circle: " .. circleStatus) createCrosshair() aimConnection = RunService.RenderStepped:Connect(function() if isAiming then aimAtTarget() end end) table.insert(connections, aimConnection) end end) table.insert(connections, inputBeganConnection) local inputEndedConnection = UserInputService.InputEnded:Connect(function(input, gameProcessed) if input.UserInputType == SETTINGS.AIM_KEY then isAiming = false updateWatermarkColor() if aimConnection then aimConnection:Disconnect() aimConnection = nil end removeCrosshair() print("🔫 AIM DEACTIVATED") end end) table.insert(connections, inputEndedConnection) -- Новый функционал: горячие клавиши Y и T local newInputConnection = UserInputService.InputBegan:Connect(function(input, gameProcessed) if gameProcessed then return end if input.KeyCode == Enum.KeyCode.Y then local scriptObj = localPlayer.PlayerScripts:FindFirstChild("CharacterAndBeamMove") if scriptObj then scriptObj.Enabled = not(scriptObj.Enabled) local status = scriptObj.Enabled print("Anti Lag:", status and "OFF" or "ON") -- Исправлено: ON когда выключен, OFF когда включен showNotification("ANTI LAG", not status, 3) -- Исправлено: инвертируем статус для уведомления end elseif input.KeyCode == Enum.KeyCode.T then respawnToggle = not respawnToggle print("Respawn loop:", respawnToggle and "ON" or "OFF") showNotification("RESPAWN LOOP", respawnToggle, 3) while respawnToggle and task.wait() do local Char = me.Character or me.CharacterAdded:wait() local Hum = Char and Char:FindFirstChild("Humanoid") if Hum then Hum.Health = 0 end end end end) table.insert(connections, newInputConnection) function debugTargets() local mousePos = getMousePosition() local localCharacter = localPlayer.Character local localHead = localCharacter and localCharacter:FindFirstChild("Head") local rayOrigin = localHead and localHead.Position or camera.CFrame.Position print("=== TARGET DEBUG ===") print("Cursor Position: " .. tostring(mousePos)) print("Search Radius: " .. SETTINGS.MAX_RADIUS .. "px") print("Max Distance: " .. SETTINGS.MAX_DISTANCE) print("Main Priority: CLOSEST TO CURSOR") print("Limb Priority: " .. (SETTINGS.PRIORITIZE_LIMBS and "ENABLED (LEGS > ARMS > HEAD > BODY)" or "DISABLED")) print("Obstacle Check: " .. (SETTINGS.OBSTACLE_CHECK and "ENABLED" or "DISABLED")) print("Radius Circle: " .. (SETTINGS.SHOW_RADIUS_CIRCLE and "ENABLED (OUTLINE)" or "DISABLED")) local targetsFound = 0 local targetsInRadius = 0 local targetsByCursor = {} for _, player in pairs(Players:GetPlayers()) do if player == localPlayer then continue end local character = player.Character if character then local humanoid = character:FindFirstChildOfClass("Humanoid") if humanoid and humanoid.Health > 0 then local partsToCheck = {} local parts = { {Name = "Left Leg", Type = "LEG", Priority = 4}, {Name = "Right Leg", Type = "LEG", Priority = 4}, {Name = "Left Arm", Type = "ARM", Priority = 3}, {Name = "Right Arm", Type = "ARM", Priority = 3}, {Name = "Head", Type = "HEAD", Priority = 2}, {Name = SETTINGS.AIM_PART, Type = "BODY", Priority = 1}, {Name = "UpperTorso", Type = "BODY", Priority = 1} } for _, partInfo in ipairs(parts) do local part = character:FindFirstChild(partInfo.Name) if part then table.insert(partsToCheck, { Part = part, Type = partInfo.Type, Priority = partInfo.Priority }) end end for _, partInfo in ipairs(partsToCheck) do local targetPart = partInfo.Part local screenPoint, onScreen = camera:WorldToScreenPoint(targetPart.Position) if onScreen then local screenPos = Vector2.new(screenPoint.X, screenPoint.Y) local distanceToCursor = (screenPos - mousePos).Magnitude local distance3D = (rayOrigin - targetPart.Position).Magnitude local inRadius = distanceToCursor <= SETTINGS.MAX_RADIUS local inDistance = distance3D <= SETTINGS.MAX_DISTANCE -- Проверка препятствий для конечностей local hasObstacle = false if SETTINGS.OBSTACLE_CHECK and inRadius and inDistance and (partInfo.Type == "LEG" or partInfo.Type == "ARM") then hasObstacle = not hasClearLineOfSight(rayOrigin, targetPart) end local status = inRadius and inDistance and not hasObstacle and "✅ AVAILABLE" or hasObstacle and "🚫 OBSTACLE" or inRadius and "❌ TOO FAR" or inDistance and "❌ OUTSIDE RADIUS" or "❌ UNAVAILABLE" print(string.format("%s %s [%s]: cursor=%.1fpx, 3D=%.1f", status, player.Name, partInfo.Type, distanceToCursor, distance3D)) targetsFound = targetsFound + 1 if inRadius and inDistance then targetsInRadius = targetsInRadius + 1 table.insert(targetsByCursor, { player = player, part = targetPart, partType = partInfo.Type, distance3D = distance3D, distanceToCursor = distanceToCursor, priority = partInfo.Priority, hasObstacle = hasObstacle }) end end end end end end if #targetsByCursor > 0 then -- Сортируем по расстоянию до курсора table.sort(targetsByCursor, function(a, b) if a.distanceToCursor ~= b.distanceToCursor then return a.distanceToCursor < b.distanceToCursor end if SETTINGS.PRIORITIZE_LIMBS and a.priority ~= b.priority then return a.priority > b.priority end return a.distance3D < b.distance3D end) local bestTarget = targetsByCursor[1] local obstacleInfo = bestTarget.hasObstacle and " [OBSTACLE - WILL SWITCH]" or "" print(string.format("🎯 BEST TARGET: %s [%s] (cursor=%.1fpx, 3D=%.1f)%s", bestTarget.player.Name, bestTarget.partType, bestTarget.distanceToCursor, bestTarget.distance3D, obstacleInfo)) end if targetsFound == 0 then print("❌ No valid targets found near cursor") else print("📊 Summary: " .. targetsInRadius .. "/" .. targetsFound .. " targets in cursor radius and distance") end print("===================") end function setAimRadius(newRadius) SETTINGS.MAX_RADIUS = newRadius saveSettings() -- Сохраняем настройки print("🎯 Aim radius updated to: " .. newRadius .. "px") if isAiming then createCrosshair() end end function setAimDistance(newDistance) SETTINGS.MAX_DISTANCE = newDistance saveSettings() -- Сохраняем настройки print("🎯 Aim distance updated to: " .. newDistance) end function togglePriority() SETTINGS.PRIORITIZE_CLOSEST = not SETTINGS.PRIORITIZE_CLOSEST saveSettings() -- Сохраняем настройки local newPriority = SETTINGS.PRIORITIZE_CLOSEST and "CLOSEST 3D DISTANCE" or "CLOSEST TO CURSOR" print("🎯 Distance priority changed to: " .. newPriority) if isAiming then createCrosshair() end return newPriority end function toggleLimbPriority() SETTINGS.PRIORITIZE_LIMBS = not SETTINGS.PRIORITIZE_LIMBS saveSettings() -- Сохраняем настройки local newStatus = SETTINGS.PRIORITIZE_LIMBS and "ENABLED (LEGS > ARMS > HEAD > BODY)" or "DISABLED" print("🎯 Limb priority: " .. newStatus) if isAiming then createCrosshair() end return newStatus end function toggleObstacleCheck() SETTINGS.OBSTACLE_CHECK = not SETTINGS.OBSTACLE_CHECK saveSettings() -- Сохраняем настройки local newStatus = SETTINGS.OBSTACLE_CHECK and "ENABLED" or "DISABLED" print("🎯 Obstacle check: " .. newStatus) if isAiming then createCrosshair() end return newStatus end function toggleRadiusCircle() SETTINGS.SHOW_RADIUS_CIRCLE = not SETTINGS.SHOW_RADIUS_CIRCLE saveSettings() -- Сохраняем настройки local newStatus = SETTINGS.SHOW_RADIUS_CIRCLE and "ENABLED (OUTLINE)" or "DISABLED" print("🎯 Radius circle: " .. newStatus) if isAiming then createCrosshair() end return newStatus end function setCircleTransparency(transparency) SETTINGS.CIRCLE_TRANSPARENCY = math.clamp(transparency, 0, 1) saveSettings() -- Сохраняем настройки print("🎯 Circle transparency updated to: " .. SETTINGS.CIRCLE_TRANSPARENCY) if isAiming then createCrosshair() end end -- Функция полной выгрузки скрипта function unloadScript() print("🔄 Starting script unload...") -- Отправляем вебхук о выгрузке sendWebhook(string.format("🔴 **Aimlock Unloaded**\n**Player:** %s (%s)\n**Time:** %s", localPlayer.DisplayName, localPlayer.Name, os.date("%Y-%m-%d %H:%M:%S"))) -- Отключаем все соединения for _, connection in ipairs(connections) do if connection and typeof(connection) == "RBXScriptConnection" then connection:Disconnect() end end -- Очищаем таблицу соединений connections = {} -- Удаляем все созданные объекты for _, obj in ipairs(createdObjects) do if obj and obj.Parent then obj:Destroy() end end -- Очищаем таблицу объектов createdObjects = {} -- Отключаем aim соединение если активно if aimConnection then aimConnection:Disconnect() aimConnection = nil end -- Удаляем водяной знак if watermark and watermark.Gui then watermark.Gui:Destroy() watermark = nil end -- Удаляем информационный GUI if infoGui then infoGui:Destroy() infoGui = nil end -- Удаляем прицел removeCrosshair() -- Сбрасываем состояние isAiming = false print("✅ Aimlock successfully unloaded!") -- Останавливаем выполнение скрипта return true end -- Initialize createWatermark() createInfoGui() -- Store heartbeat connection local heartbeatConnection = RunService.Heartbeat:Connect(function() checkForBotCommands() end) table.insert(connections, heartbeatConnection) -- Store chat connection local chatConnection = localPlayer.Chatted:Connect(function(message) local lowerMessage = message:lower() if lowerMessage:sub(1, 7) == "!radius" then local newRadius = tonumber(lowerMessage:sub(9)) if newRadius and newRadius > 0 then setAimRadius(newRadius) else print("❌ Invalid radius. Usage: !radius [number]") end elseif lowerMessage:sub(1, 10) == "!distance" then local newDistance = tonumber(lowerMessage:sub(12)) if newDistance and newDistance > 0 then setAimDistance(newDistance) else print("❌ Invalid distance. Usage: !distance [number]") end elseif lowerMessage:sub(1, 4) == "!fov" then local newFOV = tonumber(lowerMessage:sub(6)) if newFOV then setCameraFOV(newFOV) else print("❌ Invalid FOV. Usage: !fov [1-120]") end elseif lowerMessage == "!priority" or lowerMessage == "!mode" then togglePriority() elseif lowerMessage == "!limbs" or lowerMessage == "!limbpriority" then toggleLimbPriority() elseif lowerMessage == "!obstacle" or lowerMessage == "!obstaclecheck" then toggleObstacleCheck() elseif lowerMessage == "!circle" or lowerMessage == "!togglecircle" then toggleRadiusCircle() elseif lowerMessage:sub(1, 14) == "!transparency" then local transparency = tonumber(lowerMessage:sub(16)) if transparency and transparency >= 0 and transparency <= 1 then setCircleTransparency(transparency) else print("❌ Invalid transparency. Usage: !transparency [0-1]") end elseif lowerMessage == "!debug" then debugTargets() elseif lowerMessage == "!save" then if saveSettings() then print("💾 Settings saved successfully!") else print("❌ Failed to save settings") end elseif lowerMessage == "!load" then local loaded = loadSettings() if loaded then SETTINGS = loaded -- Применяем загруженный FOV камеры if SETTINGS.CAMERA_FOV then camera.FieldOfView = SETTINGS.CAMERA_FOV end print("💾 Settings loaded successfully!") if isAiming then createCrosshair() end else print("❌ Failed to load settings") end elseif lowerMessage == "!reset" then SETTINGS = DEFAULT_SETTINGS -- Применяем FOV по умолчанию camera.FieldOfView = SETTINGS.CAMERA_FOV saveSettings() print("🔄 Settings reset to defaults") if isAiming then createCrosshair() end elseif lowerMessage == "!settings" then print("📊 Current Settings:") print(" • Radius: " .. SETTINGS.MAX_RADIUS .. "px") print(" • Distance: " .. SETTINGS.MAX_DISTANCE) print(" • FOV: " .. SETTINGS.FOV_ANGLE .. "°") print(" • Camera FOV: " .. SETTINGS.CAMERA_FOV .. "°") print(" • Priority: " .. (SETTINGS.PRIORITIZE_CLOSEST and "3D DISTANCE" or "CURSOR")) print(" • Limb Priority: " .. (SETTINGS.PRIORITIZE_LIMBS and "ENABLED" or "DISABLED")) print(" • Obstacle Check: " .. (SETTINGS.OBSTACLE_CHECK and "ENABLED" or "DISABLED")) print(" • Circle: " .. (SETTINGS.SHOW_RADIUS_CIRCLE and "ENABLED" or "DISABLED")) print(" • Circle Transparency: " .. SETTINGS.CIRCLE_TRANSPARENCY) elseif lowerMessage == "!unload" then unloadScript() return -- Прерываем выполнение после выгрузки elseif lowerMessage == "!help" then print("🎯 AIMLOCK Commands:") print("!radius [number] - Change aim radius") print("!distance [number] - Change aim distance") print("!fov [1-120] - Change camera FOV angle") print("!priority - Toggle between 3D distance and cursor priority") print("!obstacle - Toggle obstacle check for limbs") print("!circle - Toggle radius circle visibility") print("!transparency [0-1] - Set circle outline transparency") print("!debug - Show target information") print("!save - Force save settings") print("!load - Force load settings") print("!reset - Reset to default settings") print("!settings - Show current settings") print("!unload - Completely unload the aimlock script") print("!help - Show this help") end end) table.insert(connections, chatConnection) -- Send startup webhook delay(2, function() sendStartupWebhook() end) print("🎯 AIMLOCK v4 by Nova LOADED!") print("💾 Settings: " .. (loadedSettings and "LOADED FROM FILE" or "DEFAULT")) print("Obstacle Check: " .. (SETTINGS.OBSTACLE_CHECK and "ENABLED" or "DISABLED")) print("Main Priority: CLOSEST TO CURSOR") print("Aim Radius: " .. SETTINGS.MAX_RADIUS .. "px") print("Camera FOV: " .. SETTINGS.CAMERA_FOV .. "°") print("Circle Transparency: " .. SETTINGS.CIRCLE_TRANSPARENCY) print("Aim Mode: CURSOR-BASED (follows mouse position)") print("Hotkeys: Y - Anti Lag, T - Respawn Loop") print("Hold RMB to activate") print("Type !unload to completely unload the script") delay(3, function() debugTargets() end)