Script that checks other events doesn't check all the events?

Made an account just to ask this but I'm trying to set up this event where the event will read if a certain self switch is on for different events in different maps. I had found the script to do that and it works but my problem is that it just stopped working?
1714333277290.png

My problem isnt the script itself because it works for the first room and in a second room I used to have but my problem is it won't read more than one event in the third room. The screenshot above checks only one of the events in that room and the puzzle works but the moment I added another event it stops working. I even created a temporary event just to test out that room itself thinking it was because its not in the same room as the event checking it
1714333301005.png

The screenshot above is the event I made to check just that room and same thing happens, if I have the script for just the one that works it goes fine but the moment I add another one if doesn't read it. Please help? The only other idea I have is that the SaveEventLocation by Yanify Engine Plugins is doing something but I'm not sure. Is it the script itself? Is it a bug?
I couldn't find another thread on this and I'm desprate
Try removing the leading zeros in your identifiers :

e.g. $gameSelfSwitches.value([10,4,'D'])
instead of $gameSelfSwitches.value([010,004,'D'])
Try removing the leading zeros in your identifiers :

e.g. $gameSelfSwitches.value([10,4,'D'])
instead of $gameSelfSwitches.value([010,004,'D'])
Oh my gosh why did I not think of this, it's working now thank you sm a lifesaver fr
Just for a quick explanation - even though they're written that way in the editor's database, when you put the 0s in front in JavaScript, it reads them as octal values (as opposed to base 10).

So some numbers will be interpreted as the same value, but some won't - for example, 010 is 8.

Omitting the 0s in front refers to them as regular, base ten values.

Original thread: https://forums.rpgmakerweb.com/threads/script-that-checks-other-events-doesnt-check-all-the-events.168151/