Hello Creation Kit community.
I've have a trouble to get to work the ToggleOption "Remove Initial Spells" that I've created im My Mod Menu.
Here the script that should remove the spells:
scriptname SHRemoveInitialSpells extends ReferenceAliasGlobalVariable property AARemoveInitialSpells autoActor property PlayerRef autoSpell property Flames autoSpell property Healing autoPerk property SHAAInitialSpellsPerk autofunction setInitialSpells() if(AARemoveInitialSpells.GetValue() == 1) PlayerRef.AddPerk(SHAAInitialSpellsPerk) elseIf (AARemoveInitialSpells.Getvalue() == 0) PlayerRef.RemovePerk(SHAAInitialSpellsPerk) endIf if (PlayerRef.HasPerk(SHAAInitialSpellsPerk)) PlayerRef.RemoveSpell(Flames) PlayerRef.RemoveSpell(Healing) else PlayerRef.AddSpell(Flames) PlayerRef.AddSpell(Healing) endIf endFunctionevent OnPlayerLoadGame() setInitialSpells()endEvent
Then the script who add and manage the ToggleOption in my Mod menu:
event OnPageReset(String page) if page == ("General Settings") setGeneralPage() endIfendEventfunction setGeneralPage() AddHeaderOption("Spells") removeInitSpellsO = AddToggleOption("Remove Initial Spells", false)endFunctionevent OnOptionSelect(int option) ; Text Options ; Toggle Options if(option == removeInitSpellsO) initialSpellsState = !initialSpellsState if(AARemoveInitialSpells.GetValue() != 0) AARemoveInitialSpells.SetValue(0) else AARemoveInitialSpells.SetValue(1) endIf SetToggleOptionValue(option, initialSpellsState) endIfendEvent
The ToggleOption in menu working but it does not remove the spells Flames and Healing from Magic Menu.
Any help?