local player = game:GetService("Players").LocalPlayer local runService = game:GetService("RunService") -- Create UI local screenGui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui")) screenGui.Name = "WoodTypeCounter" local frame = Instance.new("Frame", screenGui) frame.Size = UDim2.new(0, 220, 0, 300) frame.Position = UDim2.new(0, 10, 0.4, 0) frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30) frame.BackgroundTransparency = 0.3 local label = Instance.new("TextLabel", frame) label.Size = UDim2.new(1, -10, 1, -10) label.Position = UDim2.new(0, 5, 0, 5) label.BackgroundTransparency = 1 label.TextColor3 = Color3.fromRGB(255, 255, 255) label.TextSize = 14 label.Font = Enum.Font.Code label.TextXAlignment = Enum.TextXAlignment.Left label.TextYAlignment = Enum.TextYAlignment.Top label.TextWrapped = true local function getWoodData() local woodCounts = {} for _, item in ipairs(workspace:GetDescendants()) do -- LT2 identifies wood parts as "WoodSection" if item.Name == "WoodSection" and item:IsA("BasePart") then -- Check ownership (LT2 uses Owner attribute or Owner value) local ownerValue = item:FindFirstChild("Owner") or item.Parent:FindFirstChild("Owner") if ownerValue and ownerValue.Value == player then -- Get wood type from TreeClass attribute/value local treeClass = item:FindFirstChild("TreeClass") or item.Parent:FindFirstChild("TreeClass") local woodType = treeClass and treeClass.Value or "Unknown" woodCounts[woodType] = (woodCounts[woodType] or 0) + 1 end end end return woodCounts end -- Update Loop task.spawn(function() while true do local data = getWoodData() local displayText = "--- My Wood Inventory ---\n" local total = 0 for woodType, count in pairs(data) do displayText = displayText .. string.format("%s: %d\n", woodType, count) total = total + count end displayText = displayText .. "------------------------\n" displayText = displayText .. "Total Pieces: " .. total label.Text = displayText task.wait(2) end end)