I just created my first script. It is intended to dispel the invisibility effect on the player if any number of a variety of controls is being pressed. I have tested it and it appears to work as intended. I would just like to know if there is anything obviously dumb that I've done here that a more experienced script creator would spot and shake their head at.
scn aaaInvisBreakerfloat fQuestDelayTimeshort stagearray_var effectListlong effectCodeshort arrayIndexbegin gamemode if(stage == 0) set fQuestDelayTime to 0.001 set stage to 1 elseif(stage == 1) if(IsControlPressed 0 || IsControlPressed 1 || IsControlPressed 2 || IsControlPressed 3 || IsControlPressed 6 || IsControlPressed 7 || IsControlPressed 8 || IsControlPressed 17 || IsControlPressed 28) set arrayIndex to -1 let effectList := player.getActiveEffectCodes While (arrayIndex += 1) < ar_size effectList Let effectCode := effectList[arrayIndex] if (MagicEffectFromCode effectCode == INVI) if (player.DispelNthAE arrayIndex) Break endif endif Loop endif endif end
Thanks for taking a look.