VItrom Posted July 17, 2019 Share Posted July 17, 2019 Hello, this is my very first post :)So, first of all, I know NOTHING about scripts hehe, but recently I wanted a mod to automatic transfer caps from a container to me. I am using a mod called "Sattlement Garage Sale" which auto sells everything I store In an especific container, so I was wondering if is it possible to create a Script to add in this cotainer to auto transfer the generated caps to me.I tryed to creat a Script based in what I red, but no success at all and I am really lost here. Can Somebody give me a light?tkkss This is the Script I made Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)AddInventoryEventFilter(caps001) if akBaseItem = caps001 int index = GemList.Find(caps001) if index = 0 DLC05WorkshopHopper05.RemoveItem(bottlecaps, 0) = Game.GetPlayer() endifEndEvent Link to comment Share on other sites More sharing options...
Evangela Posted July 18, 2019 Share Posted July 18, 2019 (edited) Event OnInit() AddInventoryEventFilter(caps001) EndEvent Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) if akBaseItem == caps001 int containerCaps = DLC05WorkshopHopper05.GetItemCount(caps001) if containerCaps > 0 DLC05WorkshopHopper05.RemoveItem(caps001, containerCaps, false, Game.GetPlayer()) endif endif EndEvent You're only looking for caps, so you don't need to iterate through a list. Also if this is on alias, change OnInit() to OnAliasInit(). Edited July 18, 2019 by Rasikko Link to comment Share on other sites More sharing options...
VItrom Posted July 18, 2019 Author Share Posted July 18, 2019 Event OnInit() AddInventoryEventFilter(caps001) EndEvent Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) if akBaseItem == caps001 int containerCaps = DLC05WorkshopHopper05.GetItemCount(caps001) if containerCaps > 0 DLC05WorkshopHopper05.RemoveItem(caps001, containerCaps, false, Game.GetPlayer()) endif endif EndEvent You're only looking for caps, so you don't need to iterate through a list. Also if this is on alias, change OnInit() to OnAliasInit(). Hey! Tanks for helpping! So, I copied and paste the script, but the compiler finds a feel errors like Non recognize "caps001" wich is king off weard. I Testes In game too whith booth the options you gave, but nothing :( Maybe its becouse the source of the Bottlecaps? Link to comment Share on other sites More sharing options...
hereami Posted July 20, 2019 Share Posted July 20, 2019 (edited) Must declare header and Property (at top): Scriptname MyScripName extends ObjectReference MiscObject Property caps001 Auto Mandatory Const https://www.creationkit.com/fallout4/index.php?title=Papyrus_Introductionhttps://www.creationkit.com/fallout4/index.php?title=Variables_and_Properties Edited July 20, 2019 by hereami Link to comment Share on other sites More sharing options...
Recommended Posts