Jump to content

Help with GetEquipped function


Battallboi

Recommended Posts

The conditional GetEquipped simply doesn't work on the left hand as far as i know, not sure if there's a workaround not involving papyrus.

 

With papyrus, add this script to the smelter itself, make a container in a new empty cell (or inaccesible below the smelter), make the container a linked ref of the smelter and just use Getitemcount condition pointing at that container on the conditions of the recipes. The script basically adds copies of the weapons equipped by the player to the container when the smelter is activated. Haven't tested but it should work, i think.

 

ScriptName SmelterConditionUpdate Extends ObjectReference

ObjectReference MycontainerRef

Event OnInit()
   MycontainerRef = self.GetLinkedRef()
EndEvent

Event OnActivate(ObjectReference akactivator)
   If akactivator == Game.GetPlayer()
      Actor Player = akactivator as Actor
      MycontainerRef.RemoveAllItems()
      Weapon weapleft = Player.GetEquippedWeapon(true)
      If weapleft && !MycontainerRef.GetItemCount(weapleft)
          MycontainerRef.Additem(weapleft)
      Endif
      Weapon weapright = Player.GetEquippedWeapon(false)
      If weapright && !MycontainerRef.GetItemCount(weapright)
          MycontainerRef.Additem(weapright)
      Endif
   Endif
EndEvent
Link to comment
Share on other sites

  • Recently Browsing   0 members

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