Jump to content

EquipItem call on NPC not working


jrs3071

Recommended Posts

Hello All

 

I have modded an NPC and removed the default outfit. To prevent naked condition I am attaching script to NPC that handles the OnInit event in hopes of equipping clothing. However, my calls to equipitem have no effect. What gives? Am I missing something? TIA.

 

Scriptname GetDressed extends ReferenceAlias

 

Armor Property ClothesPrisonerRags auto

 

Function doequip()

 

self.EquipItem( ClothesPrisonerRags ) ; doesn't work

self.getActorReference().EquipItem( ClothesPrisonerRags ) ; doesn't work

 

Debug.Notification( "IsEquipped: " + self.IsEquipped( ClothesPrisonerRags ) )

;always returns 0 for unequipped!!!

 

endFunction

 

Event onInit()

Debug.Notification("Annekke Get Dressed")

;Utility.wait(7)

doequip()

endEvent

Edited by jrs3071
Link to comment
Share on other sites

Have You fill property for ClothesPrisonerRags and your script must extend actor instead of referencealias like this


Scriptname GetDressed extends Actor

Armor Property ClothesPrisonerRags auto

Function Doequip()
Self.EquipItem( ClothesPrisonerRags ) 
EndFunction

Event onInit()
Debug.Notification("Annekke Get Dressed")
Doequip()
EndEvent

Link to comment
Share on other sites

  • Recently Browsing   0 members

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