Actor property PlayerRef autoBool bStopLoop = falseEvent OnEffectStart(Actor akTarget, Actor akCaster);Float CurrentPercent = PlayerRef.GetActorValuePercentage("Magikca")Float BaseMag = PlayerRef.GetBaseActorValue("Magicka")Float CurrentMag = PlayerRef.GetActorValue("Magicka") If akCaster == PlayerRef While bStopLoop == false debug.notification("While loop has started.") If CurrentMag == BaseMag akCaster.InterruptCast() bStopLoop = true Endif EndWhile EndifEndEvent
Notification keeps playing regardless. The loop is supposed to stop when the magicka reaches maximum. I've already tried changing the loop to 'PlayerRef.GetActorValuePercentage("Magicka") < 1.0'
As an additional side effect, it keeps playing even when the effect is gone(the casting stopped.)
The second statement works as intended at least for interruptCast.
I made a Convert Stamina to Magicka type spell, but the stamina keeps draining even when the magicka is full, so I'm trying to stop the effect when the magicka is full.