I'm making a text game, and in this game you have an inventory. You search for items, and I have a function set to search for items. If someone already has an item, then how do I set the next item to whatever they found.
To make it simple, what I want is
inv = {}
if "player finds item" then
inv[nextvalue] = founditem
-- not the actual code
But I don't know how to get the set the nextvalue. Please help!