Hello, I have four variables (slotcounter1, slotcounter2, slotcounter3 and slotcounter4) and they all start with the value "open".
There is also another variable called "currentslotnum" which is always a numerical value between 1 and 4.

When a button is clicked, i want it to make the correct slotcounter variable say "closed". For example, if the currentslotnum is 3, then slotcounter3 should equal "closed".

I've got this code, but the variable doesn't seem to be changing to "closed". Anyone know why?

Code:
_root["slotcounter" + currentslotnum] = "closed";