MZ script call sintax Error

Greetings all 🙂

I'm migrating a MV project to MZ, and I'm facing an error while a script call is running in a parallel event.
The script is:

Code:
If: Script: ($gameVariables.value(0002) == 24) || ($gameVariables.value(0002) == 5) || ($gameVariables.value(0002) == 9) || ($gameVariables.value(0002) == 16) || ($gameVariables.value(0002) == 20)

The error says: "sintax Error: invalid or unexpected token".


Needless to be said, this script works on MV.
Thanks a lot in advanced for the help.
if isn't supposed to be capitalized
Greetings @standardplayer:

The system itself includes such syntax:

"If: Script:" etc...
I'm wondering if, based off the example you gave, you think that the code generated in an Event is syntax for JavaScript. It isn't.

But looking back at your original example, you seem to posting event code and not JavaScript. The way it was worded confused me, and it was put in a code snippet instead of an event screenshot.
The attached picture shows what I mean by "the system includes it like this" ("If: Script:")...
If this is an error, then MZ has a basic error in the automated syntax?
1598403858222.png

The code (tho I changed the variable to 6) works fine for me? Does it work in a blank project?
Hello @Ghost ... I'll make the test and tell you how it behaves. Thanks a lot for the time and help 🙂
Hello @Ghost ... I'll make the test and tell you how it behaves. Thanks a lot for the time and help 🙂
Your pasted text is missing the first left bracket, so it has an extra right bracket at the end. The token is a ')'.
Greetings @ramza ..

What do you mean that I'm missing an extra left bracket? If I have a syntaxis error (more than obvious by now), I just cannot catch it. The help is pretty appreciated...

Thanks 🙂
Get rid of all the leading zeros

I've moved this thread to MZ Support. Thank you.

Greetings @ramza ..

What do you mean that I'm missing an extra left bracket? If I have a syntaxis error (more than obvious by now), I just cannot catch it. The help is pretty appreciated...

Thanks 🙂
Sorry, it looks like I misread your code example, I thought I saw an extra ')' at the end. I don't want to have to try to reproduce this problem on y own to confirm, but what happens if you wrap the whole thing in another set of brackets? ((variable == x) || (variable == y) || (variable == z))

I suspect maybe the token is the 'or' separator, as the whole thing isn't wrapped in brackets.

When you encounter an error like this on screen, you can press f12, and click on the console tab at the top to see the full error message, it's usually several lines long, and tells you exactly what the problem is, if you know how to read it.

Post that full error message here and we'll be way more likely to be able to help you.
Greetings all:

@Shaz: thanks a lot for your suggestion.

@ramza: thanks a lot for the F12 for the full error message: I'll use this from now on...
I've tried @Ghosts' suggestion of creating a new project and began debugging the error.. it all seems the token error was "lines beyond" this sentence I've presented, but the compiler stopped in this line by "any reason".

Thank you all for your help and patience... I'm deeply pleased for the helpful and friendly attitude (pretty few trolls, really)...

My best wishes...
It depends on what plugins you've got. I know with MV, Yanfly had a plugin that would pick up errors and report them, but without the plugin I can't remember if the game just continued and did weird things, or crashed but didn't give you any info about the reason.

Did you get it to work after all that? Did you discover what caused it?

Original thread: https://forums.rpgmakerweb.com/threads/mz-script-call-sintax-error.126096/