Table.sort for UI Inventory

I’m trying to sort my inventory by two variables, originally it was simply sorted by the items Tier (1 - 9). So Tier 9 being highest would go first. I simply used Layout order for this. But now the inventory is getting crowded. So my goal is to sort the inventory first alphabetically. Then keeping the alphabetical order, sort the Tiers. So if AK-47 is first alphabetically. Then AK-47(TIER 9), AK-47 (TIER 3), AK-47(TIER 1), AK101(TIER 9). I tried using table.sort, but i dont feel like it can accomplish this? or maybe I just cant.

I’m looking for ideas before i move forward with something overly complicated.

1 Like

I would stay with the LayoutOrder method but do something like this:
Each tier adds 1000 to the LayoutOrder (so tier 9 adds 9000)
The alphabetical sorting then adds to the other 999, so you can preserve the alphabetical order and the tier


I ended up sorting the table alphabetically, getting the index position an item is in the sorted table and using 1000 for sorting, then i just took away the tier100.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.