You’re welcome. And I would recommend going down the tag-prefix road,
if(gender == GENDER_MALE && GetStringLeft(GetTag(oItem), 2) == "FO")
DelayCommand(0.1, AssignCommand(oPC, ActionUnequipItem(oItem)));
else if(gender == GENDER_FEMALE && GetStringLeft(GetTag(oItem), 2) == "MO")
DelayCommand(0.1, AssignCommand(oPC, ActionUnequipItem(oItem)));
then starting your female-specific items with “FO” and your male-specific items with “MO”. This is case-sensitive, meaning “MO” is not the same as “Mo”, so gender-neutral “MoleskinMoccasin” would be wearable by any gender.
You could also make this:
if(gender != GENDER_FEMALE && GetStringLeft(GetTag(oItem), 2) == "FO")
DelayCommand(0.1, AssignCommand(oPC, ActionUnequipItem(oItem)));
if(gender != GENDER_MALE && GetStringLeft(GetTag(oItem), 2) == "MO")
DelayCommand(0.1, AssignCommand(oPC, ActionUnequipItem(oItem)));
The difference between the two cases—and I’m spelling this out since you said you’re new to scripting—The first case will prevent males from equipping female-only items, and females from equipping male-only items. The second case will prevent non-females from equipping female-only items, and non-males from equipping male-only items. Since there are “other” and “both” and “none” as genders, in the first case, NB (nonbinary) creatures will be able to equip any clothing, while in the second, those NBs won’t be able to equip any gender-specific clothing.
As I said, I don’t think this matters, but maybe it’s worth thinking about. If for no reason but to expand your mind.