If Var == A
Loop 1
While Var != x ;break
Elseif Var == B
Loop 2
While Var != y ;break
Elseif Var == C
Loop 3
While Var != z ;break
scn MyLoopyEffectScriptshort counterbegin scripteffectstartset counter to 1; I always start at some value other than 0endbegin scripteffectupdateif counter == 20 set counter to 0 dispel MyHappyActorEffect;to be on the safe side return; return should cancel the effect but I use above too, just in case endifif counter;always test for some value of counter set counter to counter + 1;the code you sorta want to repeat would be here, I put a one-liner below showmessage defaultdebugmsg counterendifend
if(counter) set counter to counter -1 ;do thingselse dispel MySpell returnendif
scn My HappyQuestScriptshort Subroutinebegin GAMEMODEif subroutine set subroutine to subroutine + 1 if subroutine == 10;the actoreffect died and never came back for god knows what reason, so just resume normal processing set subroutine to 0 showmessage YourEffectJustBrokeKTHX endifendifif Subroutine == 0 if MyNPCRef.didsomething == 1 set Subroutine to 1 MyNPCref.cios MyHappyActorEffect endifendifEND
scn MyLoopyEffectScriptshort counterbegin scripteffectstartset counter to 1; I always start at some value other than 0endbegin scripteffectupdateif counter == 20 set counter to 0 set MyHappyQuest.Subroutine to 0;<---------- tells the quest script it's done dispel MyHappyActorEffect;to be on the safe side return; return should cancel the effect but I use above too, just in caseendifif counter;always test for some value of counter set counter to counter + 1;the code you sorta want to repeat would be here, I put a one-liner below showmessage defaultdebugmsg counterendifend
if(counter) set counter to counter -1;do thingselse dispel MySpell returnendif