-- ScriptsCodes | Roblox Studio Luau utility -- Run: Open your own place in Roblox Studio, choose View > Command Bar, paste this file, and press Enter. -- Output: Results appear in the Studio Output window. Edit the sample values before running. -- Pet Collection Tracker: aggregate quantities by category local pets = { { name = "Pet A", category = "Forest", quantity = 2 }, { name = "Pet B", category = "Forest", quantity = 1 }, { name = "Pet C", category = "Ocean", quantity = 3 }, } local totals = {} for _, pet in ipairs(pets) do totals[pet.category] = (totals[pet.category] or 0) + pet.quantity end for category, quantity in pairs(totals) do print(category, quantity) end