So, looking at the use of the VendorContainerKeyword, it's linked to a bunch of vendors, but not all vendors. It looks to be only vendors that can exist in a settlement, so you won't have vendors such as Takahashi or CLEO. Plus, you'd still be left with how do you get a link between the actor ref and the container ref. The link between actor and container is buried inside the faction, but F4SE hasn't cracked that set of scripts open, so it hasn't been exposed yet. Polling a couple of ref lists isn't going to work either because you'd still need to go and find each in world reference and add it to the ref collection, and then still handle the dynamic settler containers as well. It would almost be easier to set up a struct with data members of actor and objectreference, and either shove that in an array. Then you could populate the known vendors in the script properties tab with the actor and the in world ORef, and for dynamic settlers, populate new ones as they crop up. During the OnDeath() event, scroll the array, find the matching actor, and move all items.
Scriptname MoveThatIsh extends AliasReference
;Attach this to an alias on the player
Struct ContainerLink
Actor Vendor
ObjectReference VendorChest
EndStruct
ContainerLink[] ContainerArray ;This would get populated in the CK
Event OnKill(Actor akVictim)
int i = 0
While(i<ContainerArray.length)
If(akVictim == ContainerArray[i].Vendor)
ContainerArray[i].VendorChest.RemoveAllItems(Vendor)
EndIf
i += 1
EndWhile
EndEvent
;add some method to figure out when to add more vendors to the array at run time.
Edit: Added some code to show what I'm suggesting. It's mostly front work when adding all the stuff to the array. But, create a ref alias for the player, stick a script on it, and let it roll. Ok, I will try this. What does "CK" mean when you say that the array will get populated in the CK? Never mind. I see what you mean about adding the array as a property in the creation kit. Is there a way to somehow "import" my two form lists into each value of the struct array?