Ok if your like how i was and didn't get variables at all, i mucked around in VX for a while and worked out variables well a simple thing anyway so here is how to use variables to make a switch or button in RPGM VX open a chest
STEP 1:
This is making your map

STEP 2:
Make an event with a chest sprite and make it say it's locked or cant be opened or something like that

STEP 3:
Then make another event, your button or switch, make it say 'Do you want to use it?' Then make a YES OR NO decision command

STEP 4:
Under YES increase variable 1 by 1 or set to 1, this is done by going into the event commands and under game progression click control variables then in the control variables window select under Variables Sub-heading variable No. 1 , then under the operation Sub-heading select add or set and then selecting under the operand Sub-heading 'consistent' then make the value next to it 1 (you can also add a sound effect and a text command saying Did something open?

STEP 5:
Now make a new event page.

STEP 6:
Now under conditions in the side tab select the
variable option then select in the tab next to it variable No.1, then in the tab underneath select 1 and make a text command saying it has been used.
STEP 7:
Now your map in event mode should look like this

go back to the chest event and make a new event page, like what you did in the second page of the switch event make variable in the side tab 1 and equal to 1

STEP 8:
Then make a text command saying It opened then another text command saying Got (X amount of )Gold or an item then make the event to get it. Now increase variable 1 by 1 or set to 2 like what we did before in step 4

STEP 9:
Make another new event page in the side tab select variables and variable 1 but equal to 2 and make a text event "saying It has been opened"

This should work now but if you have forgotten to set a sprite for any of the events and the event pages it wont work fully.
If you have any questions about this please post a message and i will answer as soon as i can
STEP 1:
This is making your map

STEP 2:
Make an event with a chest sprite and make it say it's locked or cant be opened or something like that

STEP 3:
Then make another event, your button or switch, make it say 'Do you want to use it?' Then make a YES OR NO decision command

STEP 4:
Under YES increase variable 1 by 1 or set to 1, this is done by going into the event commands and under game progression click control variables then in the control variables window select under Variables Sub-heading variable No. 1 , then under the operation Sub-heading select add or set and then selecting under the operand Sub-heading 'consistent' then make the value next to it 1 (you can also add a sound effect and a text command saying Did something open?

STEP 5:
Now make a new event page.

STEP 6:
Now under conditions in the side tab select the
variable option then select in the tab next to it variable No.1, then in the tab underneath select 1 and make a text command saying it has been used.

STEP 7:
Now your map in event mode should look like this

go back to the chest event and make a new event page, like what you did in the second page of the switch event make variable in the side tab 1 and equal to 1

STEP 8:
Then make a text command saying It opened then another text command saying Got (X amount of )Gold or an item then make the event to get it. Now increase variable 1 by 1 or set to 2 like what we did before in step 4

STEP 9:
Make another new event page in the side tab select variables and variable 1 but equal to 2 and make a text event "saying It has been opened"

This should work now but if you have forgotten to set a sprite for any of the events and the event pages it wont work fully.
If you have any questions about this please post a message and i will answer as soon as i can

