This is based on the example script in the http://www.creationkit.com/Slot_Masks_-_Armor. I'm not sure if this is a very good way to do it from a technical perspective (particularly threading), but I think it could work. An alternative method would be to have two FormLists: one for the actor and another for his/her container. Each actor spawns a container, which is used to store copies of the base forms of equipped pieces of armor as a form of bookkeeping instead of the event specific form array (kEquippedItems). The alternative method would remove the need for the loop that waits until the actor leaves the volume.
REQUIRES SKSE.
FormList Property kActorsInVolume AutoEvent OnTriggerEnter(ObjectReference akActionRef) Actor kActor = akActionRef as Actor If(kActor) kActorsInVolume.AddForm(kActor) Form[] kEquippedItems = New Form[31] Int iSlotsChecked iSlotsChecked += 0x00100000 iSlotsChecked += 0x00200000 iSlotsChecked += 0x80000000 Int iSlot = 0x01 Int i = 0 While(iSlot < 0x80000000) If(Math.LogicalAnd(iSlotsChecked, iSlot) != iSlot) Armor kArmor = kActor.GetWornForm(iSlot) as Armor If(kArmor) kEquippedItems[i] = kArmor i += 1 iSlotsChecked += kArmor.GetSlotMask() Else iSlotsChecked += iSlot EndIf EndIf iSlot *= 2 EndWhile Weapon kRight = kActor.GetEquippedWeapon() If(kRight) kEquippedItems[i] = kRight i += 1 EndIf Weapon kLeft If(kLeft) kEquippedItems[i] = kLeft EndIf i = 0 While(i < kEquippedItems.Length) If(kEquippedItems[i]) kActor.UnequipItem(kEquippedItems[i], False, True) EndIf i += 1 EndWhile While(kActorsInVolume.Find(kActor) >= 0) Utility.WaitMenuMode(5.0) ;Adjust according to size of trigger volume and average time spent inside. EndWhile i = 0 While(i < kEquippedItems.Length) If(kEquippedItems[i]) kActor.EquipItem(kEquippedItems[i], False, True) EndIf i += 1 EndWhile EndIfEndEventEvent OnTriggerLeave(ObjectReference akActionRef) Actor kActor = akActionRef as Actor If(kActor) kActorsInVolume.RemoveAddedForm(kActor) EndIfEndEvent
I haven't tried to compile it so I can't say whether it works or not.