How do I save a hero's equipment when removing them?
When you delete a hero from the party any equipment on them gets deleted too. (Rather than delete them you might want swap them out into the reserve party; if you lock a hero while they are in the reserve party then they are hidden from the player in the Team menu.)
If you want to replace a hero, transferring their equipment to a new hero, see Scripts:Swap hero equipment.
If you want to unequip everything they have before swapping them out or deleting them, use this script:
script, unequip everything, hero, begin variable (slot) for (slot, 1, 5) do, begin # There are 5 equip slots unequip (hero, slot) end end
The argument is a party position, as returned by find hero, e.g.
unequip everything (find hero (hero: Bob))