Jump to content

A Script to Transfer Caps To Player


VItrom

Recommended Posts

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()
endif
EndEvent
Link to comment
Share on other sites

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 by Rasikko
Link to comment
Share on other sites

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...