Reading from array doesn't work

Hello i'm new to arrays in RPG-Maker MV.
I was trying the most basic things out, to see if arrays really work. Turns out, even that doesn't work.

Here is my code:

arrays.png

Shouldn't really pose a problem right? But it does.

When I try to show the value of variable 250 in a message box. It still says the value of the variable is "0"

Why?
Your third line should be $gameVariables.setValue(250, $gameVariables.value(212)[0]).

Otherwise, this should work fine when you make that adjustment.
As Ramza said, this line of your code is the problem:
JavaScript:
$gameVariables.value(250)=$gameVariables.value(212)[0];
That's because the value method returns an object/value, not a reference to the original property of $gameVariables. 🙂

Put another way: let's say variable 250 is zero at the time of assignment. The code then reads "set 0 equal to the first entry in variable 212's array". The value 0 here is without context; you can't change the value of 0 like that (it's a constant!), so nothing happens. 😮‍💨
Thanks got it now, but unfortunelately, a whole now problems has opend up, so I will open up a new thread as well. D:

Original thread: https://forums.rpgmakerweb.com/threads/reading-from-array-doesnt-work.124811/