RedxYeti Posted November 12, 2021 Share Posted November 12, 2021 Im very new to scripting so bear with me. I need help making a script that can identify or just flat out remove the weapon in the player characters hands Using a form list breaks the quest. It doesnt matter what happens to the weapon in the players hand because its forced into their hands earlier in the script and is a non essential item Maybe i can use OnItemAdded to track the item placed in the hands? tldr; i need to yeet the weapons in the players hands, no matter what they are but it cant go to the inventory Link to comment Share on other sites More sharing options...
RedxYeti Posted November 12, 2021 Author Share Posted November 12, 2021 int ListSize = myFormList.GetSize() int CurrentItems = 0 int ItemsLeft = 10; remove 10 items, change this to whatever number you want to remove while CurrentItems <= ListSize && ItemsLeft > 0 Form CurrentItem1 = myFormList.GetAt(CurrentItems) int ItemCount = PlayerREF.GetItemCount(CurrentItem1) PlayerREF.RemoveItem(CurrentItem1, ItemsLeft) ItemsLeft -= ItemCount CurrentItems += 1 endwhile i was able to butcher this to my needs from the creation kit wiki for my own needs. its pretty jank tho. Link to comment Share on other sites More sharing options...
Evangela Posted November 14, 2021 Share Posted November 14, 2021 If this is all you want to do, then you could probably check for the currently equipped weapon, store that to a variable and then have RemoveItem remove that weapon. It will remove the equipped weapon, especially if that weapon is the only instance on the player. (if there's 2, I'd say it's a 50/50 chance it'll remove the unequipped one). Link to comment Share on other sites More sharing options...
Sphered Posted November 17, 2021 Share Posted November 17, 2021 Form ForLeft = Whoever.GetEquippedObject(0)Form ForRight = Whoever.GetEquippedObject(1) Then if they exist aka something is armed, you can do GetType() checks to know what to do If its a spell, call UnequipSpell and declare it the appropriate hand slot If its an item in right hand just unequip. If its something in their left hand I think the syntax is Whoever.UnEquipItemEx(ForLeft,2,False) Link to comment Share on other sites More sharing options...
Recommended Posts