gaubanss Posted January 12, 2014 Share Posted January 12, 2014 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 CHReloadingScriptREF ContainerREFREF FormListNameREF MiscItemREFREF MiscItemTypebegin 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 endifEnd 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 More sharing options...
luthienanarion Posted January 13, 2014 Share Posted January 13, 2014 Instead of the smoke and mirrors with RemoveAllTypedItems and RemoveAllItems to remove all of a single item in a container, it's much simpler to pass a quantitiy of 99 to RemoveItem or store an exact count in a variable with GetItemCount. Link to comment Share on other sites More sharing options...
Recommended Posts