Zorkaz Posted November 24, 2024 Posted November 24, 2024 I want to craft bloodpacks that draw health. I'm using a dummy bloodpack, that will then use a script to switch itself out for a real bloodpack and also reduce health. But the script I'm using on the dummy bloodpack won't work. Any ideas? Quote Scriptname CBPBloodPackCraftScr extends ObjectReference Spell Property CBPBloodpackspell Auto Potion Property Bloodpack Auto MiscObject Property CBPBloodPackDummy Auto Keyword Property CBPBloodpackKWD Auto Event OnInit() AddInventoryEventFilter(CBPBloodpackKWD) EndEvent Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) If (akBaseItem.HasKeyword(CBPBloodpackKWD)) Game.Getplayer().Additem (Bloodpack,1,True) Game.Getplayer().removeitem (CBPBloodPackDummy,99,False) CBPBloodpackspell.cast (Game.Getplayer()) EndIf EndEvent
SKKmods Posted November 24, 2024 Posted November 24, 2024 You cant add an inventory event filter to an OBJECT script, it needs to be on the CONTAINER (actor) e.g. PlayerRef If you want an Object attached script to trigger on any container/actor then use OnContainerChanged() something like this: OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) If(akNewContainer is Actor) ; do stuff EndIf EvenEvent 1
Recommended Posts