Script Error: NoMethodError

I am trying to create a script that, depending on the actor's class, changes the MP bar to something else. It would use Syvkal's Menu Bars VXAce script (http://www.rpgmakervxace.net/topic/1799-syvkals-menu-bars-vxace/).

I used this code to start a check:

if $data_actors[11].class.id == 11 then

  whatever

end

However, when testing, I am confronted with this message:

ErrorMessage.PNG

Is there something I'm doing wrong?
I've moved this thread to Learning Ruby/RGSSx. Please be sure to post your threads in the correct forum next time. Thank you.


There is one thing that you should change immediatly: ALWAYS name your scripts.


The error message contains a '' instead of a '<your script name>'. It makes identifying the broken script much more difficult and riscs overlooking entries in unnamed slots...
I've moved this thread to Learning Ruby/RGSSx. Please be sure to post your threads in the correct forum next time. Thank you.

There is one thing that you should change immediatly: ALWAYS name your scripts.

The error message contains a '' instead of a '<your script name>'. It makes identifying the broken script much more difficult and riscs overlooking entries in unnamed slots...
Okay then. I named the script, and I can try and explain it to you in better detail:

The script itself is an (unofficial) add-on to Syvkal's Menu Bars VXAce script. As I said in my previous post, depending on the actor's class, the MP bar will be changed to something else. For example, if actor A is class 5, then the MP bar would instead display "SP". Otherwise, it would display "MP" like normal.
Forget it. Just close the thread.

Original thread: https://forums.rpgmakerweb.com/threads/script-error-nomethoderror.53844/