kaipachi Posted March 20, 2011 Share Posted March 20, 2011 Hi i'm new :wallbash: . I am making a mod that requires me to have a weapon with a bound spell that on cast binds another weapon. I have run out of extra Bound weapon spells. :confused: The only problem i have is that i need the weapon to be removed on unequip. What do I put where? My script for my bound weapon spell: ScriptName ShikaiBscript ref UserRef Begin ScriptEffectStart AddItem ShiniLV2B 1 EquipItem ShiniLV2B Endif UserRef.UnequipItem ShiniLV2B End Begin ScriptEffectFinish RemoveItem ShiniLV2B 1 End The script for the bound spell: scriptname ShikaiBAdd ref Wearer Begin OnEquip set Wearer to GetContainer Wearer.AddSpell ShikaiBEnd Begin OnUnEquip set Wearer to GetContainer Wearer.RemoveSpell ShikaiBEnd Thank you for your time. Link to comment Share on other sites More sharing options...
Deleted1848331User Posted March 21, 2011 Share Posted March 21, 2011 (edited) Hmm... Instead of UserRef, you could use Self. scn ShikaiBscript ref Self short Flag Begin ScriptEffectStart Set Flag to 0 ;Makes sure Flag variable is at 0 when this begins. Set Self to GetSelf if Flag == 0 Set Flag to 1 Self.AddItem ShiniLV2B 1 ;You ALWAYS need a reference for the scripts you do. Self.EquipItem ShiniLV2B Elseif Flag == 1 Set Flag to 2 Self.UnequipItem ShiniLV2B Endif End Begin ScriptEffectFinish Set Self to GetSelf If Flag == 2 Self.RemoveItem ShiniLV2B 1 Set Flag to 0 Endif End and scn ShikaiBAdd ref Self Begin OnEquip set Self to GetSelf Self.AddSpell ShikaiB End Begin OnUnequip set Self to GetSelf Self.RemoveSpell ShikaiB End Hope it helps :thumbsup: I find that GetContainer doesn't work too well, but it may just be me. Edited March 21, 2011 by Guest Link to comment Share on other sites More sharing options...
kaipachi Posted March 22, 2011 Author Share Posted March 22, 2011 (edited) Unfortunatly it didn't work :wacko:, thanks for you help though. I do have a theory. In this section of your script.Set Flag to 0 ;Makes sure Flag variable is at 0 when this begins. Set Self to GetSelf if Flag == 0 Set Flag to 1 Self.AddItem ShiniLV2B 1 ;You ALWAYS need a reference for the scripts you do. Self.EquipItem ShiniLV2B You have made it so when it runs it will always be zero. I beleive this makes the next section impossible. II'm not sure how to correct it if it needs correcting. Edited March 22, 2011 by kaipachi Link to comment Share on other sites More sharing options...
Deleted1848331User Posted March 23, 2011 Share Posted March 23, 2011 (edited) Ah. *facepalm* Try this: if Flag > 0 Set Flag to 0 ;Makes sure Flag variable is at 0 when this begins. endif Set Self to GetSelf if Flag == 0 Set Flag to 1 Self.AddItem ShiniLV2B 1 ;You ALWAYS need a reference for the scripts you do. Self.EquipItem ShiniLV2B THAT should work. If not, delete the Set Flag to 0 part :P Edited March 23, 2011 by Guest Link to comment Share on other sites More sharing options...
kaipachi Posted March 24, 2011 Author Share Posted March 24, 2011 Ah thank you, much better. kudo's for the help my friend. :biggrin: Can't wait to release the mod, hopefully will be soon. Link to comment Share on other sites More sharing options...
Deleted1848331User Posted March 24, 2011 Share Posted March 24, 2011 Glad to have helped :thumbsup: Link to comment Share on other sites More sharing options...
kaipachi Posted March 27, 2011 Author Share Posted March 27, 2011 I do have one more question to make my Script perfect, is there a way to remove an item if its dropped? Link to comment Share on other sites More sharing options...
Recommended Posts