--[[ Block Inspector - Hold to Select, Clean Code ]] local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local TweenService = game:GetService("TweenService") local player = Players.LocalPlayer local camera = workspace.CurrentCamera -- GUI local screenGui = Instance.new("ScreenGui") screenGui.Name = "BlockInspector" screenGui.ResetOnSpawn = false screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling screenGui.Parent = player:WaitForChild("PlayerGui") -- Инфо-панель local infoFrame = Instance.new("Frame") infoFrame.Size = UDim2.new(0, 240, 0, 130) infoFrame.Position = UDim2.new(1, -255, 0.5, -65) infoFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 30) infoFrame.BorderSizePixel = 0 infoFrame.ZIndex = 10 infoFrame.Parent = screenGui Instance.new("UICorner", infoFrame).CornerRadius = UDim.new(0, 10) local stroke = Instance.new("UIStroke", infoFrame) stroke.Color = Color3.fromRGB(0, 200, 100) stroke.Thickness = 2 -- Заголовок local title = Instance.new("TextLabel", infoFrame) title.Size = UDim2.new(1, 0, 0, 30) title.BackgroundColor3 = Color3.fromRGB(0, 180, 90) title.Text = " 🎯 BLOCK INSPECTOR" title.TextColor3 = Color3.fromRGB(255, 255, 255) title.Font = Enum.Font.GothamBold title.TextSize = 14 title.TextXAlignment = Enum.TextXAlignment.Left title.ZIndex = 11 Instance.new("UICorner", title).CornerRadius = UDim.new(0, 8) -- Тексты local nameLabel = Instance.new("TextLabel", infoFrame) nameLabel.Size = UDim2.new(1, -15, 0, 25) nameLabel.Position = UDim2.new(0, 10, 0, 35) nameLabel.BackgroundTransparency = 1 nameLabel.Text = "Hold to select block" nameLabel.TextColor3 = Color3.fromRGB(255, 220, 100) nameLabel.Font = Enum.Font.GothamBold nameLabel.TextSize = 14 nameLabel.TextXAlignment = Enum.TextXAlignment.Left nameLabel.ZIndex = 11 local posLabel = Instance.new("TextLabel", infoFrame) posLabel.Size = UDim2.new(1, -15, 0, 22) posLabel.Position = UDim2.new(0, 10, 0, 62) posLabel.BackgroundTransparency = 1 posLabel.Text = "X: --- | Y: --- | Z: ---" posLabel.TextColor3 = Color3.fromRGB(100, 255, 150) posLabel.Font = Enum.Font.Gotham posLabel.TextSize = 13 posLabel.TextXAlignment = Enum.TextXAlignment.Left posLabel.ZIndex = 11 local distLabel = Instance.new("TextLabel", infoFrame) distLabel.Size = UDim2.new(1, -15, 0, 22) distLabel.Position = UDim2.new(0, 10, 0, 85) distLabel.BackgroundTransparency = 1 distLabel.Text = "Distance: --- studs" distLabel.TextColor3 = Color3.fromRGB(255, 150, 100) distLabel.Font = Enum.Font.Gotham distLabel.TextSize = 13 distLabel.TextXAlignment = Enum.TextXAlignment.Left distLabel.ZIndex = 11 local classLabel = Instance.new("TextLabel", infoFrame) classLabel.Size = UDim2.new(1, -15, 0, 20) classLabel.Position = UDim2.new(0, 10, 0, 108) classLabel.BackgroundTransparency = 1 classLabel.Text = "Class: ---" classLabel.TextColor3 = Color3.fromRGB(180, 180, 180) classLabel.Font = Enum.Font.Gotham classLabel.TextSize = 12 classLabel.TextXAlignment = Enum.TextXAlignment.Left classLabel.ZIndex = 11 -- Линия (Tracer) local line = Instance.new("Frame", screenGui) line.Name = "Tracer" line.BackgroundColor3 = Color3.fromRGB(0, 255, 150) line.BorderSizePixel = 0 line.AnchorPoint = Vector2.new(0.5, 0) line.Size = UDim2.new(0, 2, 0, 0) line.Position = UDim2.new(0, 0, 0, 0) line.ZIndex = 100 line.Visible = false Instance.new("UICorner", line).CornerRadius = UDim.new(1, 0) local lineGlow = Instance.new("UIStroke", line) lineGlow.Color = Color3.fromRGB(0, 255, 150) lineGlow.Thickness = 2 lineGlow.Transparency = 0.5 -- Точка на блоке local targetDot = Instance.new("Frame", screenGui) targetDot.Size = UDim2.new(0, 12, 0, 12) targetDot.AnchorPoint = Vector2.new(0.5, 0.5) targetDot.BackgroundColor3 = Color3.fromRGB(255, 50, 50) targetDot.BorderSizePixel = 0 targetDot.ZIndex = 101 targetDot.Visible = false Instance.new("UICorner", targetDot).CornerRadius = UDim.new(1, 0) -- Подсветка local highlight = Instance.new("Highlight") highlight.FillColor = Color3.fromRGB(0, 255, 100) highlight.OutlineColor = Color3.fromRGB(255, 255, 0) highlight.FillTransparency = 0.6 highlight.OutlineTransparency = 0.2 -- Переменные local selectedBlock = nil local selectedPos = nil local holdStart = 0 local isHolding = false local HOLD_TIME = 0.3 -- секунды зажатия для выбора local raycastParams = RaycastParams.new() raycastParams.FilterType = Enum.RaycastFilterType.Blacklist raycastParams.IgnoreWater = true -- Обновление фильтра local function updateFilter() local char = player.Character local list = {camera} if char then table.insert(list, char) end raycastParams.FilterDescendantsInstances = list end -- Рейкаст local function raycast(screenPos) updateFilter() local ray = camera:ViewportPointToRay(screenPos.X, screenPos.Y) return workspace:Raycast(ray.Origin, ray.Direction * 1000, raycastParams) end -- Обновить линию local function updateTracer() if not selectedBlock or not selectedPos then line.Visible = false targetDot.Visible = false return end local screenTarget = camera:WorldToViewportPoint(selectedPos) local mousePos = UserInputService:GetMouseLocation() -- Для мобилы берем тач if UserInputService.TouchEnabled then local touches = UserInputService:GetTouches() if #touches > 0 then mousePos = touches[1].Position end end local startPos = Vector2.new(mousePos.X, mousePos.Y) local endPos = Vector2.new(screenTarget.X, screenTarget.Y) local delta = endPos - startPos local dist = delta.Magnitude local angle = math.atan2(delta.Y, delta.X) line.Position = UDim2.new(0, startPos.X, 0, startPos.Y) line.Size = UDim2.new(0, 3, 0, dist) line.Rotation = math.deg(angle) - 90 line.Visible = true targetDot.Position = UDim2.new(0, endPos.X, 0, endPos.Y) targetDot.Visible = true -- Обновить дистанцию local d = (selectedPos - camera.CFrame.Position).Magnitude distLabel.Text = string.format("Distance: %.1f studs", d) end -- Выбрать блок local function selectBlock(block, pos) selectedBlock = block selectedPos = pos if block then highlight.Parent = block highlight.Enabled = true nameLabel.Text = #block.Name > 20 and block.Name:sub(1, 20) .. "..." or block.Name posLabel.Text = string.format("X: %.1f | Y: %.1f | Z: %.1f", pos.X, pos.Y, pos.Z) classLabel.Text = block.ClassName infoFrame.BackgroundColor3 = Color3.fromRGB(25, 35, 25) stroke.Color = Color3.fromRGB(0, 255, 100) else highlight.Parent = nil highlight.Enabled = false nameLabel.Text = "Hold to select block" posLabel.Text = "X: --- | Y: --- | Z: ---" distLabel.Text = "Distance: --- studs" classLabel.Text = "Class: ---" line.Visible = false targetDot.Visible = false infoFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 30) stroke.Color = Color3.fromRGB(100, 100, 100) end end -- Холд логика UserInputService.InputBegan:Connect(function(input, gpe) if gpe then return end if input.UserInputType ~= Enum.UserInputType.MouseButton1 and input.UserInputType ~= Enum.UserInputType.Touch then return end isHolding = true holdStart = tick() end) UserInputService.InputEnded:Connect(function(input) if input.UserInputType ~= Enum.UserInputType.MouseButton1 and input.UserInputType ~= Enum.UserInputType.Touch then return end local holdTime = tick() - holdStart -- Если зажали достаточно долго - выбираем блок if isHolding and holdTime >= HOLD_TIME then local pos = input.Position or UserInputService:GetMouseLocation() local result = raycast(pos) if result then selectBlock(result.Instance, result.Position) else selectBlock(nil, nil) end end isHolding = false end) -- Обновление каждый кадр RunService.RenderStepped:Connect(updateTracer) -- Кнопка скрыть local toggle = Instance.new("TextButton", screenGui) toggle.Size = UDim2.new(0, 45, 0, 45) toggle.Position = UDim2.new(1, -60, 0, 15) toggle.BackgroundColor3 = Color3.fromRGB(0, 180, 90) toggle.Text = "👁️" toggle.TextColor3 = Color3.fromRGB(255, 255, 255) toggle.Font = Enum.Font.GothamBold toggle.TextSize = 20 toggle.ZIndex = 200 Instance.new("UICorner", toggle).CornerRadius = UDim.new(1, 0) local enabled = true toggle.MouseButton1Click:Connect(function() enabled = not enabled infoFrame.Visible = enabled line.Visible = enabled and selectedBlock ~= nil targetDot.Visible = enabled and selectedBlock ~= nil toggle.Text = enabled and "👁️" or "🚫" toggle.BackgroundColor3 = enabled and Color3.fromRGB(0, 180, 90) or Color3.fromRGB(80, 80, 80) end) print("✅ Block Inspector loaded - Hold click 0.3s to select")