JohnSmith047b Posted September 12, 2021 Share Posted September 12, 2021 (edited) Hello everyone, please help with a simple script. A script is attached to the clothes, which, when put on, checks the gender of the NPC. If the gender is male, then this object should be removed from the inventory of this NPC. I just can't get the REF of the clothes on which the script is. Enter manually cloth REFs in the script is a bad idea because there is a lot of it. Scriptname AaaTestScript extends ObjectReference event OnEquipped(Actor akActor) ObjectReference equipment = self ;Form equipment = GetBaseObject() if (akActor.GetActorBase().GetSex() == 0) akActor.RemoveItem(equipment, 1) Debug.MessageBox(equipment) endIf endevent Edited September 12, 2021 by JohnSmith047b Link to comment Share on other sites More sharing options...
IsharaMeradin Posted September 12, 2021 Share Posted September 12, 2021 You cannot get the "reference" to the object because it is inside an inventory and currently does not have a reference ID. See if akActor.RemoveItem(Self,1) will work instead. Link to comment Share on other sites More sharing options...
JohnSmith047b Posted September 12, 2021 Author Share Posted September 12, 2021 (edited) You cannot get the "reference" to the object because it is inside an inventory and currently does not have a reference ID. See if akActor.RemoveItem(Self,1) will work instead.Thanks for the answer. This does not work - i added item to myself and when i tried to put it on, it did not removed from the inventory (male character). The message was [AaaTestScript <Item 1 in container (00000014)>]. I expected to see REF there. Edited September 12, 2021 by JohnSmith047b Link to comment Share on other sites More sharing options...
Recommended Posts