Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Organize Items Alphabetically (v1) [10/02/2014]
- By AFRLme
- -- + --
- [email protected] | skype @ AFRLme
- --]]
- local char, items -- empty variables
- local sort_func = function( a,b ) return a:getName() < b:getName() end -- sort function (ascending A-Z, 1-10 etc)
- function arrangeItems()
- char = game:getLink(VGameCurrentCharacter) -- store current character
- items = char:getLinks(VCharacterItems) -- store items
- table.sort(items, sort_func) -- sort the items alphabetically
- char:setValue(VCharacterItems, items) -- amend new item order to the inventory
- end
Advertisement
Add Comment
Please, Sign In to add comment