I hate to be the one to say it @"Flame Cube" but I think it's pretty clear you need to go over programming basics or else instead of us helping with a specific problem (which I'm confident we can) we're going to be stuck explaining the basics which a simple tutorial on youtube will likely be much better at. That being said and hopefully not sounding rude, the code I gave:
var inventory = ["EMPTY SLOT", "EMPTY SLOT", "EMPTY SLOT", "EMPTY SLOT", "EMPTY SLOT", "EMPTY SLOT", "EMPTY SLOT", "EMPTY SLOT", "EMPTY SLOT"]
func setInventoryItem(item : Item, index : int):
if index < 9:
inventory[index] = item
This would put an item in the array at a specific index in the array. For example you could call
setInventoryItem(helmet, 0)
and it would put the helmet at the first spot in the array.