Problem with script

Post » Fri Jan 09, 2015 11:17 am

Armor Property DA Auto Actor Property PlayerRef  Auto GlobalVariable Property HelmetVar  AutoEvent OnUnequipped(Actor akActor)  if akActor == PlayerRef && PlayerRef.IsInCombat() && PlayerRef.GetItemCount(DA) == 1 && HelmetVar.GetValue() == 0HelmetVar.SetValue(1)Debug.Notification("Dragonborn Armor can not be unequiped while in combat")PlayerRef.EquipItem(DA, abSilent = true)Elseif akActor == PlayerRef && PlayerRef.IsInCombat() && PlayerRef.GetItemCount(DA) == 1 && HelmetVar.GetValue() == 1Debug.Notification("Dragonborn Armor can not be unequiped while in combat")PlayerRef.EquipItem(DA, abSilent = true)Elseif akActor == PlayerRef && PlayerRef.IsInCombat()==False && HelmetVar.GetValue() == 1 || HelmetVar.GetValue() == 2HelmetVar.SetValue(0)Debug.Notification("Dragonborn Armor can be unequiped while not in combat")endIfendEvent

This script works very well except for one problem.

Under the event on unequipped you see this script.

Elseif akActor == PlayerRef && PlayerRef.IsInCombat()==False && HelmetVar.GetValue() == 1 || HelmetVar.GetValue() == 2
HelmetVar.SetValue(0)
Debug.Notification("Dragonborn Armor can be unequiped while not in combat")

If fires while the player is in combat. While the same exact script under the event on equipped does not.

Any ideas as to why???

Thanks

User avatar
Laura Elizabeth
 
Posts: 3454
Joined: Wed Oct 11, 2006 7:34 pm

Post » Fri Jan 09, 2015 1:45 pm

First explain what the GlobalVariable is for. Are you checking for the helmet? Also is this script attached to the Dragonborn Armor?

User avatar
Patrick Gordon
 
Posts: 3366
Joined: Thu May 31, 2007 5:38 am


Return to V - Skyrim