Jump to content

Misc Item Display Script issues


gaubanss

Recommended Posts

Ok so I am trying to get a script to work that works like the display script in the Underground Bunker mod for the hidden weapons. Heres what I got.

 

ScriptName CHReloadingScript

REF ContainerREF
REF FormListName
REF MiscItemREF
REF MiscItemType

begin onactivate player

Set ContainerREF to GetLinkedREF
Set MiscItemREF to ContainerREF.GetLinkedREF

;Snap-Off Super Tool Kit
If GetISID CHK3KSnap
Set MiscItemType to K3KSuperToolKit
Set FormListName to CHK3KSNAPFL

else
showmessage CHFail
Return
endif

;========IF the Weapon is in the Container
if ContainerREF.GetItemCount MiscItemType >= 1
;Disable Static
MiscItemREF.Disable
ContainerREF.RemoveAllItems Player 1
Return

;========If the weapon is in the player inventory and staic is disabled
elseIf Player.GetItemCount MiscItemType >= 1 && MiscItemREF.GetDisabled

;Adds it to Container
player.RemoveAllTypedItems CHMiscWeapREF 1 0 40 CHAllWeapons
player.RemoveAllTypedItems ContainerREF 1 0 40 FormListName
CHMiscWeapREF.RemoveAllItems Player 1 1

;EnableStatic
MiscItemREF.Enable
Return

;========If the weapon is not in the player inventory and staic is disabled/enabled
else

showmessage CHNoSuchWeapon
endif
Return

endif
End

 

 

When the activator is clicked the display enables but the item is not removed from the inventory. Any ideas where I messed up?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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