Jump to content

Photo

A Script to Transfer Caps To Player

script help newly transfer caps mod

  • Please log in to reply
3 replies to this topic

#1
VItrom

VItrom

    Newbie

  • Members
  • Pip
  • 12 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


#2
Rasikko

Rasikko

    The Arbiter of Time

  • Members
  • PipPipPipPip
  • 1,228 posts
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, 18 July 2019 - 06:11 AM.


#3
VItrom

VItrom

    Newbie

  • Members
  • Pip
  • 12 posts
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?



#4
hereami

hereami

    Enthusiast

  • Members
  • PipPip
  • 164 posts

Must declare header and Property (at top):

Scriptname MyScripName extends ObjectReference

MiscObject Property caps001 Auto Mandatory Const

https://www.creation...us_Introduction

https://www.creation..._and_Properties


Edited by hereami, 20 July 2019 - 03:21 PM.






Also tagged with one or more of these keywords: script, help, newly, transfer, caps, mod

Page loaded in: 1.046 seconds