You have to be careful to match If and Endif blocks whenever you're scripting. If you prefer to keep the structure your currently using rather than the one _echo is suggesting it's just a matter of matching up your blocks correctly. Let's look at your code.
If Player.GetIsSex Male == 1 ; 'everything from this untill the next endif or elseif will happen if the player is male'
Elseif GetIsID MiddlePants02Female == 1 ; 'This only happens if the above is NOT true, so if the player is female'
Player.UnEquipItem MiddlePants02Female
MessageBox "This is girls clothing, I am not wearing this"
...
[/code]
You need two separate IF statements. One to check if the player is male, and inside that so it only happens if the player is male, one to find and remove the right piece of clothing.
[code]
If Player.GetIsSex Male == 1 ; 'If statement one begins, the stuff inside it only happens if the player is male'
If GetIsID MiddlePants02Female == 1 ; 'If statement two begins checking for specific clothes'
Player.UnEquipItem MiddlePants02Female
MessageBox "This is girls clothing, I am not wearing this"
Elseif GetIsID MiddlePants01Female == 1 ; 'If statement two continues only IF the first piece of clothing was not found'
Player.UnEquipItem MiddlePants01Female
MessageBox "This is girls clothing, I am not wearing this"
; 'You cary on like this untill you have all the clothing you want to check for listed then END your second IF statement still INSIDE the first one'
EndIf ; 'If statement two ends'
EndIf ; 'If statement one ends'
If you're still having trouble just post back.
Good Luck,
WT