Replacing contents of a List

I have an Inventory system set up. It works great. I am trying to extend it to do some things and I’m having problems figuring out the syntax and structure I need to use.

What I would like to happen:

  1. Present a full inventory of items.
  2. When the player right clicks on an Item, it equips that item, then clears the Inventory and refills it with new items (delineated by a string stored in the equipped items “Next Table” field.)

I have the Equip/Unequip functionality working, the part I am stuck on is the clearing and refilling of the Inventory. Any assistance is welcome!

You can use List.Clear() to clear a list. How you would fill a list would be using List.Add to all the new items you want to add to your list.

1 Like