Jump to content

OBSE Script isn't working.


BadPrenup

Recommended Posts

I am trying to make a mod that someone here requested that hides the players helmet. I figured a good old fashioned Toggle spell would work the best, and tried getting it to work but it doesn't want to fully. As far as I know every function is put in exactly how the CS Wiki says it should be. I put Works in brackets next to each part that works.

 

scn NHSpellScript

ref Helmet1
ref Helmet2

Begin ScriptEffectStart
Set Helmet1 to Player.GetEquippedObject 1;sets first ref to whatever the player is wearing in his hair slot, which is what helms use (Works)
Player.UnequipItem Helmet1;unequips the first ref (Works)
SetEquipmentSlot 255 Helmet1;changes equip slot to "No Slot" (Works)
Player.EquipItem Helmet1;Equips the helm again (Works)
Player.UnequipItem Helmet2;first time spell is cast it won't do anything because it isn't yet defined (Doesn't Work)
SetEquipmentSlot 1 Helmet2;first time spell is cast it won't do anything because it isn't yet defined (Doesn't Work)
Set Helmet2 to Helmet1;sets second ref to what the first ref is so it will unequip it next time the player changes helmets (Doesn't Work)
End

 

I have been thinking of trying a few different things:

 

Moving the stuff that doesn't work to ScriptEffectFinish.

Putting a control If function before the stuff that doesn't work to make so it only sets Helmet2 to Helmet1 the first time, perhaps the script is ending when it tries to use an undefined ref.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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