So far from true it's funny
Let me point out the flaws in your code;
1. toWear[invslot] = true is wrong since you declared "toWear" as an int array, not a boolean array.
2. You're never storing the item id that needs to be equipped
3. You're enhanced iterating though an integer array and using "toWear[i]" which will give you an index out of bounds error if the item id (that you never stored) is greater than 27.
4. You're checking if "toWear[i]" is true when it's an integer array.
5. equipItem(i) would not work since you also need to specify the item slot in a PI
6.
