for _, object in pairs(parts) do if object:IsA("BasePart") and object.Value > 0 then table.insert(valuableBlocks, {Part = object, Value = object.Value}) end end

-- LocalScript local Players = game:GetService("Players") local RunService = game:GetService("RunService")

local frame = Instance.new("Frame") frame.Size = UDim2.new(0.3, 0, 0.5, 0) frame.Position = UDim2.new(0.5, 0, 0.5, 0) frame.AnchorPoint = Vector2.new(0.5, 0.5) frame.Parent = gui

-- Sort blocks by value table.sort(valuableBlocks, function(a, b) return a.Value > b.Value end)

-- Access parts and calculate their values local function getValuableBlocks() -- Assuming "Value" property on parts signifies their value local parts = game.Workspace:GetDescendants() local valuableBlocks = {}

-- Fetch and display valuable blocks local valuableBlocks = getValuableBlocks() for i, block in pairs(valuableBlocks) do if i > 10 then break end -- Show top 10 for example

local listLayout = Instance.new("UIListLayout") listLayout.Parent = frame listLayout.FillDirection = Enum.FillDirection.Vertical

-- Setup GUI local gui = Instance.new("ScreenGui") gui.Name = "ValuableBlocksGUI" gui.Parent = script.Parent -- Assuming script is directly under StarterPlayerScripts or similar