Jump to content

Recommended Posts

Posted

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?

Posted

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.

Posted

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)
  • Recently Browsing   0 members

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