
KeylessUniversal

local player = game.Players.LocalPlayer
local function getAllItems()
local items = {}
local function scan(container)
if not container then return end
for _, v in pairs(container:GetChildren()) do
if v:IsA("Tool") then
items[v.Name] = (items[v.Name] or 0) + 1
end
end
end
scan(player:FindFirstChild("Backpack"))
scan(player.Character)
return items
end
local function printSortedInventory()
local items = getAllItems()
local list = {}
for name, count in pairs(items) do
table.insert(list, {name = name, count = count})
end
table.sort(list, function(a, b)
return a.count < b.count
end)
for _, item in ipairs(list) do
print(item.name .. " x" .. item.count)
end
end
printSortedInventory()No comments yet for this script.



