MV Adding +1 to multiple variables for note-tag.

I want to add +1 to multiple variables by using script commands for a note-tag.

I know how to do one and it works:

<Custom Recruit Effect>
"$gameVariable.setValue(126, $gameVariables.value(126) + 1);"
</Custom Recruit Effect>

but when I try to do change two or more variables like this:

<Custom Recruit Effect>
"$gameVariable.setValue(126, $gameVariables.value(126) + 1);
$gameVariable.setValue(129, $gameVariables.value(129) + 1);"
</Custom Recruit Effect>

It keeps on giving me error of invalid and unexpected tokens.
Its probably something simple but still slowly trying to learn coding.
Moved to: Plugin Support

When you get errors like that, best to hit F8, go to the Console tab, and get a screenshot to post. You've said part of the error message, but have also left out an important part - it should have told you what tokens were invalid/unexpected. Also state what plugin(s) you're using in case someone needs to go and look it up (ideally, provide a link)

At a guess, I'd say you're not meant to put the " at the start and end of the lines.
Thanks for moving it very new to posting on forums.

As far as the code for some reason it does require the " at the beginning and end (The Script is Irina_recruiting board if that makes any difference)
Thanks for moving it very new to posting on forums.

As far as the code for some reason it does require the " at the beginning and end (The Script is Irina_recruiting board if that makes any difference)
i think the problem might be the way the plugin grab the notetags... and line break might disturb the notetags grabbing (i did not see the code btw... just guessing) so... maybe try making all those to one liner instead to avoid the error... use ; as separator between each lines

example:
Code:
<Custom Recruit Effect>
"$gameVariables.setValue(126, $gameVariables.value(126) + 1); $gameVariables.setValue(129, $gameVariables.value(129) + 1);"
</Custom Recruit Effect>

that way the js code might grab properly by the notetags...
and i think notetags field has really wide field...
if you have lots of variable you changed (and maybe the field is not enough)... you could also assign $gameVariables to short name first like this:
Code:
<Custom Recruit Effect>
"var v = $gameVariables; v.setValue(126, v.value(126)+1); v.setValue(127, v.value(127)+1); v.setValue(128, v.value(128)+1); v.setValue(129, v.value(129)+1);
</Custom Recruit Effect>

hope this help

edit: wait... i realize your js code have typo...
instead of $gameVariable... it should have been $gameVariables
you forgot the s in some of the code... maybe try fixing that first... in case it work just by doing that 😀.
Thanks Estriole that code worked perfectly and Shaz you were right after some more testing the " at the beginning and end basically canceled out the code

Thank you both!

Original thread: https://forums.rpgmakerweb.com/threads/adding-1-to-multiple-variables-for-note-tag.134663/