SandMouseAnarchy Posted June 2, 2018 Posted June 2, 2018 Im using GetWornItem(3) to get the players chest armor. Scriptname ReEquipArmor extends ObjectReference Const Event OnEquipped(Actor akActor) Actor Player = Game.GetPlayer() int index = 0 int end = 43 const while (index < end) Actor:WornItem wornItem = Player.GetWornItem(3) ;Debug.notification("Slot Index: " + index + ", " + wornItem) Debug.notification("Item: " + wornItem.Item) index += 1 EndWhile endevent in game it returns a notification saying "item form", so i think its working(?) Ive been trying to equip/unequip the 'WornItem' with player.EquipItem(getbaseobject() as armor) and player.EquipItem(wornitem.item() as armor) and similar variations but i cant get anything to equip.What am i doing wrong?
dagobaking Posted June 3, 2018 Posted June 3, 2018 If you are using "GetWornItem" it is already equipped.
SandMouseAnarchy Posted June 3, 2018 Author Posted June 3, 2018 I realise that the item will already be equipped if I can use 'GetWornItem' but I can't unequip the item directly, Eg:Actor:WornItem WornItem = player.GetWornItem(3)Player.UnequipItem(WornItem) Doesn't work for me, when I compile I get errors saying that WornItem is not a property or not a variable, I've tried WornItem.Item and WornItem.model but neither of those work either. Basically - I don't know how to reference the 'getWornItem()' in the unequip section.
dagobaking Posted June 3, 2018 Posted June 3, 2018 When describing code problems you should always show exactly the code you are using rather than short-hand because it will throw off people trying to help. Try this: Form equipment = PlayerRef.GetWornItem(3).Item PlayerRef.UnequipItem(equipment)
SandMouseAnarchy Posted June 5, 2018 Author Posted June 5, 2018 I'll remember that :) thanks mate that worked nicely :)
Recommended Posts