<|im_start|>user
How can I create a simple inventory system in Lua for my game?<|im_end|>
<|im_start|>assistant
```lua
-- Function to create a new inventory
function createInventory()
    return {
        items = {},
        addItem = function(self, item)
            table.insert(self.items, item)
        end,
        removeItem = function(self, item)
            for i, v in ipairs(self.items) do
                if v == item then
                    table.remove(self.items, i)
                    break
                end
            end
        end,
        displayItems = function(self)
            for i, item in ipairs(self.items) do
                print(i .. ": " .. item)
            end
        end
    }
end<|im_end|>

<|im_start|>user
How can I create a simple inventory system in Lua for my game?<|im_end|>
<|im_start|>assistant
```lua
inventory = {}
function addItem(item)
    table.insert(inventory, item)
end<|im_end|>

How can I create a simple inventory system in Lua for my game?