Variable not defined? How do I fix this?

When I load my variables, this pops up, what am I doing wrong?

I'm trying to ass 10808 to the 7th variable in my database
I've tried using [] to refer to my variable, as well as referencing my variable as 0007, still not sure where I'm wrong at.
($gameVariable.value(7)+10808)
If anyone would help, that would be great! 😀
image.jpg
Try this maybe?

Code:
$gameVariables.setValue(7, $gameVariables.value(7) + 10808)
First
my variable as 0007
NEVER use leading zeroes for any ID.
Those zeroes are only there due to the formatting of the editor, but they should never be used when in aprogramming language, because a leading zero tells the computer to use a different number system, like 0x means a hexadecimal value, and 00 is an octal value.

Second
You don't need a script for simply adding a number to a variable.
And you should try to use script commands only where absolutely neccessary, using the regular event command where possible.

yes, that sometimes means you need two or three event commands instead of one - but the event commands are protected and can't crash your game. Script boxes on the other hand can do anything.
That can be an advantage if you know what you're doing, but it also means that you have to know what you're doing or you risk much more than just crashing your game.
Set the variable with the editor to 0 in the editor before operating with the script.
Plus, wasn't it $gameVariables?
[Edit] The right way to set a variable is the one Ahuramazda said.

Try this maybe?

Code:
$gameVariables.setValue(7, $gameVariables.value(7) + 10808)
Set the variable with the editor to 0 in the editor before operating with the script.
the variables are already defined, the OP had a typo in his command
Try this maybe?

Code:
$gameVariables.setValue(7, $gameVariables.value(7) + 10808)
IT WORKED THANK YOU SO MUCH!!

Original thread: https://forums.rpgmakerweb.com/threads/variable-not-defined-how-do-i-fix-this.149100/