(Solved)Movement route variables missing an '=' ?

I'm trying to change the value of a variable inside the movement route of an event.
I looked around and found this code:

$gameVariables.setValue(x, $gameVariables.value(x) = [value])
With 'x' being the number of the variable, without the added 0's in front of it.

This seems to work, except that that this same event should be deleted afterwards, and the next event page should be triggered to erase the event.
So right now I have this:

(in the movement route of page 1 of the event)
$gameVariables.setValue(97, $gameVariables.value(97) = 5)

This should set the value of Variable 97 to 5.

Page 3 of the event triggers on Variable 97 = 5... and should immediately delete the event.
Except this does not happen. The event is stil there as if it is playing normally.
Do I have to add another '=' to that line, like so?:

$gameVariables.setValue(97, $gameVariables.value(97) == 5)
$gameVariables.setValue(97, 5)


Should be something like this.
I looked around and found this code:

$gameVariables.setValue(x, $gameVariables.value(x) = [value])
I don't know where you found that because it is simply wrong

As in the example given above, there should not be a single = in the formula at all, even that single one is too many.

the command is simply

$gameVariables.setValue(ID, value);
$gameVariables.setValue(97, 5)


Should be something like this.

I don't know where you found that because it is simply wrong

As in the example given above, there should not be a single = in the formula at all, even that single one is too many.

the command is simply

$gameVariables.setValue(ID, value);
I see.

Thank you both! It seems to work now.
I got the code I used from a thread from 3 or so years ago, but I must have misread or misinterpreted it.
I'm not that familiar yet with the script calls.

Thanks again!
.value is a function; you can't assign it a value.

Original thread: https://forums.rpgmakerweb.com/threads/solved-movement-route-variables-missing-an.175172/