Zorkaz Posted April 14, 2021 Share Posted April 14, 2021 So I put this on a container. It should refuse items that are not holotapes, bobbleheads, loose mods and books but it now accepts every item.Did I overlook some simple script logic or might akBaseItem not work with ".haskeyword()"? Scriptname HCHolotapeInventoryFilterSc extends ObjectReference Holotape Property HCHolotape Auto Int Property LeInt Auto Keyword Property BobbleheadKeyword Auto Keyword Property ObjectTypeLooseMod Auto Event Oninit() Self.AddInventoryEventFilter(akFilter = None) EndEvent Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) If (akBaseItem is Holotape) If Self.getitemcount (HCHolotape) >=1 Self.removeitem (HCHolotape) Game.Getplayer().Additem (HCHolotape) Endif Elseif (akBaseItem is Book) ;Do nothing Elseif (akBaseItem.haskeyword (BobbleheadKeyword)) ;Do nothing Elseif (akBaseItem.haskeyword (ObjectTypeLooseMod)) ;Do nothing Else LeInt = AiItemCount Game.Getplayer().Additem (AkBaseItem, AiItemCount) Self.removeitem (AkBaseItem, AiItemCount) Endif EndEvent (I used debug notifications but they won't show up) Link to comment Share on other sites More sharing options...
niston Posted April 14, 2021 Share Posted April 14, 2021 Does the script even compile? Link to comment Share on other sites More sharing options...
Zorkaz Posted April 14, 2021 Author Share Posted April 14, 2021 Of course. I found the culprit. In the testsave the inventory filter got removed Link to comment Share on other sites More sharing options...
Recommended Posts