// This method does not use ActionEquipMostEffectiveArmor() and is a workaround // to allow equipping clothing. It will equip any armor in the entering object's // inventory. It can easily be modified to be used on a NPC's spawn script, but // this is a good thing to have on a trigger around the module spawn point for // PCs. Thanks to georage. void main() { // Get the entering object object oNPC = GetEnteringObject(); string sLocal = "DO_ONCE" + ObjectToString(OBJECT_SELF); // Only do this once, and only to NPCs if(GetLocalInt(oNPC, sLocal) || GetIsPC(oNPC)) return; // Set to not do it again SetLocalInt(oNPC, sLocal, TRUE); // Loop the object's inventory and equip the first object oItem = GetFirstItemInInventory(oNPC); while(GetIsObjectValid(oItem)) { // Check if armor, of course if(GetBaseItemType(oItem) == BASE_ITEM_ARMOR) { // Equip it and stop the script AssignCommand(oNPC, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST)); return; } oItem = GetNextItemInInventory(oNPC); } }