[RESOLVED] Can I get the index (position) of an InventoryItem in the inv list

Started by Joacim Andersson, Mon 18/11/2024 23:25:36

Previous topic - Next topic

Joacim Andersson

Well, the subject pretty much say it all. I want to get the position in the inventory list an InventoryItem is at, the whole reason is that in my game when you use the item in a special way, it is supposed to change. So I want to replace it with another item, but let the new item be in the same position in the list.

I've searched through the help file but we no success.

eri0o

You can use ItemAtIndex from the InventoryWindow you are using to check all the indexes until ItemCount, so you can know the index of your specific inventory item.
When you do player.AddInventory, the second parameter is the desired index.


SMF spam blocked by CleanTalk