I've become quite annoyed at this.
The following works at the end of a script, destroying the object referenced:
if(GetFirstItemInInventory(OBJECT_SELF)==OBJECT_INVALID)
DestroyObject(GetObjectByTag("250B6_WEAPON1"),0.0);
So, as to avoid creating multiple scripts to do the same thing for multiple objects, I moved the TAG referenced above to a string variable on the object that runs the script line noted above.
sString string 250B6_WEAPON1
I modified the script line above to the following:
string sItem = GetLocalString(OBJECT_SELF, "sString");
object oContainer = GetNearestObjectByTag(sItem);
if(GetFirstItemInInventory(OBJECT_SELF)==OBJECT_INVALID)
DestroyObject(oContainer,0.0);
The object in question is no longer destroyed.
Making it DestroyObject(GetObjectByTag("250B6_WEAPON1"),0.0); works.
Having it DestroyObject(oContainer,0.0); does not work.
FP!