The one confused here gotta be me...
Are you telling us that you simply created a new script section in the editor and pasted that there?
Like really!? No wonder why it'd never work.
Let me explain you this. When the game is loading, aka the big black nothing screen, it won't ever find those variables because they're created or loaded after you have opened the Scene_Title or the Scene_Load scenes and quickly switch to the Scene_Map. So yeah, it SHOULD FAIL otherwise!
I see. I'm sorry, I'm still figuring out scripting and the reference guide is difficult for me to understand. I've made a lot of progress through trial and error and through reverse-engineering the code in the editor, but I'm still in the dark about a lot!
Maybe I should clarify what I'm actually trying to accomplish, and we can see if there's an easier way to go about it.
I'm trying to set it to where, while the player has an armor item equipped, a variable is increased by a set number. The variable would be decreased by that same number if the player unequipped the armor, so the variable bonus only exists while the armor is worn.
The easiest way I could figure to do that was:
1. Find a script that lets me tie switches to armor items.
2. Create a switch for each armor item in the game. While the armor is worn, its respective switch is turned on.
3. Set the game so that, if the switch was 'true,' the related variable is increased.
4. Set the game so that, if the switch was 'true' but the armor was not equipped, decrease the related variable and set the switch back to 'false.'
But alas, I'm stuck trying to get Step 2 to work.