--[[ Block Inspector - Click/Tap to Select ]] 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, 260, 0, 160) infoFrame.Position = UDim2.new(1, -280, 0.5, -80) infoFrame.BackgroundColor3 = Color3.fromRGB(15, 15, 25) infoFrame.BorderSizePixel = 0 infoFrame.ZIndex = 10 infoFrame.Parent = screenGui local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, 12) corner.Parent = infoFrame local stroke = Instance.new("UIStroke") stroke.Color = Color3.fromRGB(0, 255, 150) stroke.Thickness = 2 stroke.Parent = infoFrame -- Заголовок local title = Instance.new("TextLabel") title.Size = UDim2.new(1, 0, 0, 35) title.BackgroundColor3 = Color3.fromRGB(0, 200, 100) title.Text = " 🎯 BLOCK SELECTOR" title.TextColor3 = Color3.fromRGB(255, 255, 255) title.Font = Enum.Font.GothamBold title.TextSize = 16 title.TextXAlignment = Enum.TextXAlignment.Left title.ZIndex = 11 title.Parent = infoFrame local titleCorner = Instance.new("UICorner") titleCorner.CornerRadius = UDim.new(0, 10) titleCorner.Parent = title -- Имя блока local nameLabel = Instance.new("TextLabel") nameLabel.Size = UDim2.new(1, -20, 0, 30) nameLabel.Position = UDim2.new(0, 10, 0, 40) nameLabel.BackgroundTransparency = 1 nameLabel.Text = "Click on a block" nameLabel.TextColor3 = Color3.fromRGB(255, 255, 100) nameLabel.Font = Enum.Font.GothamBold nameLabel.TextSize = 15 nameLabel.TextXAlignment = Enum.TextXAlignment.Left nameLabel.ZIndex = 11 nameLabel.Parent = infoFrame -- Координаты local posLabel = Instance.new("TextLabel") posLabel.Size = UDim2.new(1, -20, 0, 25) posLabel.Position = UDim2.new(0, 10, 0, 75) posLabel.BackgroundTransparency = 1 posLabel.Text = "X: --- | Y: --- | Z: ---" posLabel.TextColor3 = Color3.fromRGB(100, 255, 150) posLabel.Font = Enum.Font.Gotham posLabel.TextSize = 14 posLabel.TextXAlignment = Enum.TextXAlignment.Left posLabel.ZIndex = 11 posLabel.Parent = infoFrame -- Расстояние local distLabel = Instance.new("TextLabel") distLabel.Size = UDim2.new(1, -20, 0, 25) distLabel.Position = UDim2.new(0, 10, 0, 100) distLabel.BackgroundTransparency = 1 distLabel.Text = "Distance: --- studs" distLabel.TextColor3 = Color3.fromRGB(255, 150, 100) distLabel.Font = Enum.Font.Gotham distLabel.TextSize = 14 distLabel.TextXAlignment = Enum.TextXAlignment.Left distLabel.ZIndex = 11 distLabel.Parent = infoFrame -- Класс и Parent local classLabel = Instance.new("TextLabel") classLabel.Size = UDim2.new(1, -20, 0, 22) classLabel.Position = UDim2.new(0, 10, 0, 125) 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 classLabel.Parent = infoFrame -- ЛИНИЯ-УКАЗКА (фиксируется на выбранном блоке) local lineContainer = Instance.new("Frame") lineContainer.Name = "LineContainer" lineContainer.Size = UDim2.new(1, 0, 1, 0) lineContainer.BackgroundTransparency = 1 lineContainer.ZIndex = 100 lineContainer.Parent = screenGui local lineFrame = Instance.new("Frame") lineFrame.Name = "PointerLine" lineFrame.BackgroundColor3 = Color3.fromRGB(0, 255, 150) lineFrame.BorderSizePixel = 0 lineFrame.AnchorPoint = Vector2.new(0.5, 0) lineFrame.ZIndex = 101 lineFrame.Visible = false lineFrame.Parent = lineContainer local lineCorner = Instance.new("UICorner") lineCorner.CornerRadius = UDim.new(1, 0) lineCorner.Parent = lineFrame local lineGlow = Instance.new("UIStroke") lineGlow.Color = Color3.fromRGB(0, 255, 150) lineGlow.Thickness = 3 lineGlow.Transparency = 0.4 lineGlow.Parent = lineFrame -- Точка на блоке (цель) local targetDot = Instance.new("Frame") targetDot.Name = "TargetDot" targetDot.Size = UDim2.new(0, 16, 0, 16) targetDot.AnchorPoint = Vector2.new(0.5, 0.5) targetDot.BackgroundColor3 = Color3.fromRGB(255, 50, 50) targetDot.BorderSizePixel = 0 targetDot.ZIndex = 102 targetDot.Visible = false targetDot.Parent = lineContainer local targetDotCorner = Instance.new("UICorner") targetDotCorner.CornerRadius = UDim.new(1, 0) targetDotCorner.Parent = targetDot local targetPulse = Instance.new("UIStroke") targetPulse.Color = Color3.fromRGB(255, 100, 100) targetPulse.Thickness = 3 targetPulse.Transparency = 0.5 targetPulse.Parent = targetDot -- Точка у пальца/мышки local fingerDot = Instance.new("Frame") fingerDot.Name = "FingerDot" fingerDot.Size = UDim2.new(0, 12, 0, 12) fingerDot.AnchorPoint = Vector2.new(0.5, 0.5) fingerDot.BackgroundColor3 = Color3.fromRGB(100, 200, 255) fingerDot.BorderSizePixel = 0 fingerDot.ZIndex = 102 fingerDot.Visible = false fingerDot.Parent = lineContainer local fingerDotCorner = Instance.new("UICorner") fingerDotCorner.CornerRadius = UDim.new(1, 0) fingerDotCorner.Parent = fingerDot -- Подсветка выбранного блока local highlight = Instance.new("Highlight") highlight.FillColor = Color3.fromRGB(0, 255, 100) highlight.OutlineColor = Color3.fromRGB(255, 255, 0) highlight.FillTransparency = 0.5 highlight.OutlineTransparency = 0 -- Переменные local selectedBlock = nil local selectedPosition = nil local isMobile = UserInputService.TouchEnabled local raycastParams = RaycastParams.new() raycastParams.FilterType = Enum.RaycastFilterType.Blacklist raycastParams.IgnoreWater = true -- Обновление фильтра local function updateFilter() local char = player.Character local filterList = {camera, screenGui} if char then table.insert(filterList, char) end raycastParams.FilterDescendantsInstances = filterList end -- Рейкаст local function raycastFromScreen(screenPos) updateFilter() local ray = camera:ViewportPointToRay(screenPos.X, screenPos.Y) return workspace:Raycast(ray.Origin, ray.Direction * 1000, raycastParams) end -- Обновление линии между двумя точками на экране local function updateLine(screenStart, screenEnd) local delta = screenEnd - screenStart local distance = delta.Magnitude local angle = math.atan2(delta.Y, delta.X) lineFrame.Position = UDim2.new(0, screenStart.X, 0, screenStart.Y) lineFrame.Size = UDim2.new(0, 4, 0, distance) lineFrame.Rotation = math.deg(angle) - 90 lineFrame.Visible = true fingerDot.Position = UDim2.new(0, screenStart.X, 0, screenStart.Y) fingerDot.Visible = true targetDot.Position = UDim2.new(0, screenEnd.X, 0, screenEnd.Y) targetDot.Visible = true end -- Скрыть линию local function hideLine() lineFrame.Visible = false fingerDot.Visible = false targetDot.Visible = false end -- Выбор блока local function selectBlock(block, worldPos) selectedBlock = block selectedPosition = worldPos if block and block:IsA("BasePart") then highlight.Parent = block highlight.Enabled = true -- Обновляем панель nameLabel.Text = "🎯 " .. (string.len(block.Name) > 18 and string.sub(block.Name, 1, 18) .. "..." or block.Name) posLabel.Text = string.format("📍 X: %.2f | Y: %.2f | Z: %.2f", worldPos.X, worldPos.Y, worldPos.Z) local dist = (worldPos - camera.CFrame.Position).Magnitude distLabel.Text = string.format("📏 Distance: %.1f studs", dist) classLabel.Text = "🏷️ " .. block.ClassName .. " | Parent: " .. (block.Parent and block.Parent.Name or "nil") -- Анимация выбора TweenService:Create(infoFrame, TweenInfo.new(0.2), { BackgroundColor3 = Color3.fromRGB(25, 35, 25) }):Play() stroke.Color = Color3.fromRGB(0, 255, 100) else highlight.Parent = nil highlight.Enabled = false hideLine() nameLabel.Text = "Click on a block" posLabel.Text = "X: --- | Y: --- | Z: ---" distLabel.Text = "Distance: --- studs" classLabel.Text = "Class: ---" TweenService:Create(infoFrame, TweenInfo.new(0.2), { BackgroundColor3 = Color3.fromRGB(15, 15, 25) }):Play() stroke.Color = Color3.fromRGB(100, 100, 100) end end -- Обработка клика/тача local function onInputBegan(input, gameProcessed) if gameProcessed then return end if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then local screenPos = input.Position local result = raycastFromScreen(screenPos) if result and result.Instance then selectBlock(result.Instance, result.Position) else selectBlock(nil, nil) end end end UserInputService.InputBegan:Connect(onInputBegan) -- Обновление линии каждый кадр (следует за пальцем/мышкой) RunService.RenderStepped:Connect(function() if not selectedBlock or not selectedPosition then hideLine() return end -- Получаем текущую позицию пальца/мышки local inputPos = nil if isMobile then local touches = UserInputService:GetTouches() if #touches > 0 then inputPos = touches[1].Position end else inputPos = UserInputService:GetMouseLocation() end if not inputPos then hideLine() return end -- Конвертируем мировую позицию блока в экранную local screenTarget = camera:WorldToViewportPoint(selectedPosition) -- Обновляем линию от пальца к блоку updateLine(inputPos, Vector2.new(screenTarget.X, screenTarget.Y)) -- Обновляем расстояние в реальном времени local currentDist = (selectedPosition - camera.CFrame.Position).Magnitude distLabel.Text = string.format("📏 Distance: %.1f studs", currentDist) -- Пульсация точки на блоке local pulse = 1 + math.sin(tick() * 5) * 0.3 targetDot.Size = UDim2.new(0, 16 * pulse, 0, 16 * pulse) end) -- Кнопка сброса local clearBtn = Instance.new("TextButton") clearBtn.Size = UDim2.new(0, 30, 0, 30) clearBtn.Position = UDim2.new(1, -40, 0, 2) clearBtn.BackgroundColor3 = Color3.fromRGB(255, 80, 80) clearBtn.Text = "✕" clearBtn.TextColor3 = Color3.fromRGB(255, 255, 255) clearBtn.Font = Enum.Font.GothamBold clearBtn.TextSize = 18 clearBtn.ZIndex = 12 clearBtn.Parent = infoFrame local clearCorner = Instance.new("UICorner") clearCorner.CornerRadius = UDim.new(0, 8) clearCorner.Parent = clearBtn clearBtn.MouseButton1Click:Connect(function() selectBlock(nil, nil) end) -- Кнопка вкл/выкл GUI local toggleBtn = Instance.new("TextButton") toggleBtn.Size = UDim2.new(0, 50, 0, 50) toggleBtn.Position = UDim2.new(1, -70, 0, 20) toggleBtn.BackgroundColor3 = Color3.fromRGB(0, 200, 100) toggleBtn.Text = "👁️" toggleBtn.TextColor3 = Color3.fromRGB(255, 255, 255) toggleBtn.Font = Enum.Font.GothamBold toggleBtn.TextSize = 24 toggleBtn.ZIndex = 200 toggleBtn.Parent = screenGui local btnCorner = Instance.new("UICorner") btnCorner.CornerRadius = UDim.new(1, 0) btnCorner.Parent = toggleBtn local enabled = true toggleBtn.MouseButton1Click:Connect(function() enabled = not enabled infoFrame.Visible = enabled lineContainer.Visible = enabled toggleBtn.Text = enabled and "👁️" or "🚫" toggleBtn.BackgroundColor3 = enabled and Color3.fromRGB(0, 200, 100) or Color3.fromRGB(100, 100, 100) end) print("✅ Block Inspector loaded!") print("👆 Click/Tap on any block to select it") print("👉 Line will follow your finger/mouse from the block")