"Wait" script call not working how I want it to

Okay, we're getting somewhere! So go ahead and change line 102 of my plugin to read
Code:
return [this._allTargets[index]];
Okay, we're getting somewhere! So go ahead and change line 102 of my plugin to read
Code:
return [this._allTargets[index]];
2024-10-01_screenshot02.png
Oops, also change it on line 101, this._targets.length to this._allTargets.length
Oops, also change it on line 101, this._targets.length to this._allTargets.length
2024-10-01_screenshot03.png

It hit every target, and then struck 7 random targets.
Oops, also change it on line 101, this._targets.length to this._allTargets.length
UPDATE: I forgot to change the target for the first action effect from "target" to "targetnum 0", and this is what happened:
2024-10-01_screenshot04.png

2024-10-01_screenshot05.png

It hit the random targets, then hit the initial target multiple times.
Alright, good - I think you can get rid of the console.log stuff, that fixed the targetnum - anything else is in your action sequence.
Alright, good - I think you can get rid of the console.log stuff, that fixed the targetnum - anything else is in your action sequence.
Ok! Here's the action sequence:
Code:
<target action>
perform start
motion chant: user
motion wait: user
motion spell: user
motion wait: user
action animation: targetnum 0
animation wait: 10
action effect: targetnum 0
if (target.getStateCounter(29) >= 7)
    action animation: targetnum 1
    animation wait: 5
    action effect: targetnum 1
    action animation: targetnum 2
    animation wait: 5
    action effect: targetnum 2
    action animation: targetnum 3
    animation wait: 5
    action effect: targetnum 3
    action animation: targetnum 4
    animation wait: 5
    action effect: targetnum 4
    action animation: targetnum 5
    animation wait: 5
    action effect: targetnum 5
    action animation: targetnum 6
    animation wait: 5
    action effect: targetnum 6
    action animation: targetnum 7
    animation wait: 5
    action effect: targetnum 7
else if (!target.isStateAffected(29))
    add state: targetnum 0
end
</target action>
What's the scope of your skill?

Try putting an empty
<whole action>
</whole action>

If that doesn't work, you can try putting a break action command at the bottom, after the end.
What's the scope of your skill?

Try putting an empty
<whole action>
</whole action>

If that doesn't work, you can try putting a break action command at the bottom, after the end.
Putting break action at the end of the target action fixed it!

Original thread: https://forums.rpgmakerweb.com/threads/wait-script-call-not-working-how-i-want-it-to.172255/