local Players = game:GetService("Players") local Workspace = game:GetService("Workspace") local RunService = game:GetService("RunService") local player = Players.LocalPlayer local camera = Workspace.CurrentCamera -- 1. Создаем главный GUI local screenGui = Instance.new("ScreenGui") screenGui.Name = "SniperZoomAndCrosshair" screenGui.ResetOnSpawn = false screenGui.IgnoreGuiInset = true -- Игнорирует верхнюю панель для идеального центра screenGui.Parent = player:WaitForChild("PlayerGui") -- 2. Панель управления (перетаскиваемая) local frame = Instance.new("Frame") frame.Size = UDim2.new(0, 250, 0, 280) frame.Position = UDim2.new(0.05, 0, 0.4, 0) frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30) frame.BorderSizePixel = 0 frame.Active = true frame.Draggable = true frame.Parent = screenGui -- Заголовок панели local title = Instance.new("TextLabel") title.Size = UDim2.new(1, 0, 0, 25) title.Text = "Sniper Pro Menu" title.TextColor3 = Color3.fromRGB(255, 255, 255) title.BackgroundColor3 = Color3.fromRGB(45, 45, 45) title.BorderSizePixel = 0 title.Parent = frame -- --- Текстовое поле 1: Сила зума --- local zoomBox = Instance.new("TextBox") zoomBox.Size = UDim2.new(0.9, 0, 0, 24) zoomBox.Position = UDim2.new(0.05, 0, 0, 30) zoomBox.PlaceholderText = "10" zoomBox.Text = "10" zoomBox.TextColor3 = Color3.fromRGB(255, 255, 255) zoomBox.BackgroundColor3 = Color3.fromRGB(20, 20, 20) zoomBox.BorderSizePixel = 0 zoomBox.Parent = frame local zoomLabel = Instance.new("TextLabel") zoomLabel.Size = UDim2.new(0.9, 0, 0, 14) zoomLabel.Position = UDim2.new(0.05, 0, 0, 54) zoomLabel.Text = "Сила зума | Zoom strength" zoomLabel.TextColor3 = Color3.fromRGB(180, 180, 180) zoomLabel.TextSize = 10 zoomLabel.BackgroundTransparency = 1 zoomLabel.Parent = frame -- --- Кнопка Вкл/Выкл Зума --- local toggleZoomBtn = Instance.new("TextButton") toggleZoomBtn.Size = UDim2.new(0.9, 0, 0, 26) toggleZoomBtn.Position = UDim2.new(0.05, 0, 0, 72) toggleZoomBtn.Text = "Зум: ВЫКЛ" toggleZoomBtn.TextColor3 = Color3.fromRGB(255, 255, 255) toggleZoomBtn.BackgroundColor3 = Color3.fromRGB(150, 50, 50) toggleZoomBtn.BorderSizePixel = 0 toggleZoomBtn.Parent = frame -- --- Кнопка Вкл/Выкл Точки --- local toggleDotBtn = Instance.new("TextButton") toggleDotBtn.Size = UDim2.new(0.9, 0, 0, 26) toggleDotBtn.Position = UDim2.new(0.05, 0, 0, 102) toggleDotBtn.Text = "Точка: ВКЛ" toggleDotBtn.TextColor3 = Color3.fromRGB(255, 255, 255) toggleDotBtn.BackgroundColor3 = Color3.fromRGB(50, 150, 50) toggleDotBtn.BorderSizePixel = 0 toggleDotBtn.Parent = frame -- --- Текстовое поле 2: Размер точки --- local dotSizeBox = Instance.new("TextBox") dotSizeBox.Size = UDim2.new(0.9, 0, 0, 24) dotSizeBox.Position = UDim2.new(0.05, 0, 0, 132) dotSizeBox.PlaceholderText = "6" dotSizeBox.Text = "6" dotSizeBox.TextColor3 = Color3.fromRGB(255, 255, 255) dotSizeBox.BackgroundColor3 = Color3.fromRGB(20, 20, 20) dotSizeBox.BorderSizePixel = 0 dotSizeBox.Parent = frame local dotSizeLabel = Instance.new("TextLabel") dotSizeLabel.Size = UDim2.new(0.9, 0, 0, 14) dotSizeLabel.Position = UDim2.new(0.05, 0, 0, 156) dotSizeLabel.Text = "Размер точки | Dot size" dotSizeLabel.TextColor3 = Color3.fromRGB(180, 180, 180) dotSizeLabel.TextSize = 10 dotSizeLabel.BackgroundTransparency = 1 dotSizeLabel.Parent = frame -- --- Текстовое поле 3: Количество скрываемых блоков --- local hideBlocksBox = Instance.new("TextBox") hideBlocksBox.Size = UDim2.new(0.9, 0, 0, 24) hideBlocksBox.Position = UDim2.new(0.05, 0, 0, 174) hideBlocksBox.PlaceholderText = "0" hideBlocksBox.Text = "0" hideBlocksBox.TextColor3 = Color3.fromRGB(255, 255, 255) hideBlocksBox.BackgroundColor3 = Color3.fromRGB(20, 20, 20) hideBlocksBox.BorderSizePixel = 0 hideBlocksBox.Parent = frame local hideBlocksLabel = Instance.new("TextLabel") hideBlocksLabel.Size = UDim2.new(0.9, 0, 0, 14) hideBlocksLabel.Position = UDim2.new(0.05, 0, 0, 198) hideBlocksLabel.Text = "Скрывать блоков (кроме игроков) | Hide blocks" hideBlocksLabel.TextColor3 = Color3.fromRGB(180, 180, 180) hideBlocksLabel.TextSize = 9 hideBlocksLabel.BackgroundTransparency = 1 hideBlocksLabel.Parent = frame -- --- Текстовое поле 4: Цвет точки (RGB) --- local colorBox = Instance.new("TextBox") colorBox.Size = UDim2.new(0.9, 0, 0, 24) colorBox.Position = UDim2.new(0.05, 0, 0, 216) colorBox.PlaceholderText = "0, 255, 0" colorBox.Text = "0, 255, 0" colorBox.TextColor3 = Color3.fromRGB(255, 255, 255) colorBox.BackgroundColor3 = Color3.fromRGB(20, 20, 20) colorBox.BorderSizePixel = 0 colorBox.Parent = frame local colorLabel = Instance.new("TextLabel") colorLabel.Size = UDim2.new(0.9, 0, 0, 14) colorLabel.Position = UDim2.new(0.05, 0, 0, 240) colorLabel.Text = "Цвет RGB | RGB color" colorLabel.TextColor3 = Color3.fromRGB(180, 180, 180) colorLabel.TextSize = 10 colorLabel.BackgroundTransparency = 1 colorLabel.Parent = frame -- Точка строго посередине экрана local centerDot = Instance.new("Frame") centerDot.Size = UDim2.new(0, 6, 0, 6) centerDot.AnchorPoint = Vector2.new(0.5, 0.5) centerDot.Position = UDim2.new(0.5, 0, 0.5, 0) centerDot.BackgroundColor3 = Color3.fromRGB(0, 255, 0) centerDot.BorderSizePixel = 0 centerDot.Parent = screenGui -- Логика зума и скрытия блоков local isZoomed = false local hiddenParts = {} local function clearHiddenParts() for part, originalTransparency in pairs(hiddenParts) do if part and part.Parent then part.Transparency = originalTransparency end end hiddenParts = {} end local function updateZoom() if isZoomed then local num = tonumber(zoomBox.Text) if num then if num < 1 then num = 1 end local targetFov = 70 / num camera.FieldOfView = math.clamp(targetFov, 0.0001, 70) else camera.FieldOfView = 70 end else camera.FieldOfView = 70 clearHiddenParts() end end toggleZoomBtn.MouseButton1Click:Connect(function() isZoomed = not isZoomed if isZoomed then toggleZoomBtn.Text = "Зум: ВКЛ" toggleZoomBtn.BackgroundColor3 = Color3.fromRGB(50, 150, 50) else toggleZoomBtn.Text = "Зум: ВЫКЛ" toggleZoomBtn.BackgroundColor3 = Color3.fromRGB(150, 50, 50) end updateZoom() end) zoomBox.FocusLost:Connect(function() if isZoomed then updateZoom() end end) -- Автоматическое скрытие блоков (игнорируя всех игроков) во время прицеливания RunService.RenderStepped:Connect(function() clearHiddenParts() if not isZoomed then return end local hideCount = tonumber(hideBlocksBox.Text) if not hideCount or hideCount <= 0 then return end local origin = camera.CFrame.Position local direction = camera.CFrame.LookVector * 100000 local raycastParams = RaycastParams.new() raycastParams.FilterType = Enum.RaycastFilterType.Exclude local ignoreList = {screenGui} if player.Character then table.insert(ignoreList, player.Character) end local hiddenCountFound = 0 local maxIterations = 20 local iter = 0 while hiddenCountFound < hideCount and iter < maxIterations do iter = iter + 1 raycastParams.FilterDescendantsInstances = ignoreList local result = Workspace:Raycast(origin, direction, raycastParams) if not result or not result.Instance then break end local hitPart = result.Instance -- Проверяем, принадлежит ли найденная деталь какому-либо игроку local isPlayer = false for _, p in ipairs(Players:GetPlayers()) do if p.Character and hitPart:IsDescendantOf(p.Character) then isPlayer = true break end end if isPlayer then -- Если это игрок, просто пропускаем его и продолжаем луч дальше table.insert(ignoreList, hitPart) origin = result.Position + (camera.CFrame.LookVector * 0.1) else if hitPart:IsA("BasePart") then if not hiddenParts[hitPart] then hiddenParts[hitPart] = hitPart.Transparency end hitPart.Transparency = 1 table.insert(ignoreList, hitPart) origin = result.Position + (camera.CFrame.LookVector * 0.1) hiddenCountFound = hiddenCountFound + 1 else break end end end end) -- Логика переключения точки local dotVisible = true toggleDotBtn.MouseButton1Click:Connect(function() dotVisible = not dotVisible centerDot.Visible = dotVisible if dotVisible then toggleDotBtn.Text = "Точка: ВКЛ" toggleDotBtn.BackgroundColor3 = Color3.fromRGB(50, 150, 50) else toggleDotBtn.Text = "Точка: ВЫКЛ" toggleDotBtn.BackgroundColor3 = Color3.fromRGB(150, 50, 50) end end) -- Мгновенное изменение размера точки при вводе dotSizeBox:GetPropertyChangedSignal("Text"):Connect(function() local size = tonumber(dotSizeBox.Text) if size then size = math.clamp(size, 1, 200) centerDot.Size = UDim2.new(0, size, 0, size) end end) -- Логика смены цвета точки colorBox.FocusLost:Connect(function() local r, g, b = colorBox.Text:match("(%d+),%s*(%d+),%s*(%d+)") if r and g and b then r = math.clamp(tonumber(r), 0, 255) g = math.clamp(tonumber(g), 0, 255) b = math.clamp(tonumber(b), 0, 255) centerDot.BackgroundColor3 = Color3.fromRGB(r, g, b) end end)