MV (Solved) RPG Maker MV ID of the equipped items?

Hello ^^

Myself and a buddy of mine are currently working on a game and we are a bit pissed off about a script. We have the following problem with converting the currently equipped equipment into one or more variables.

If we use the script command (inJS)

"$ gameVariables.setValue (" variableId ", $ gameActors.
actor ("actorId"). equips ("slotId")); "

enter the program spits the following into the variable:

", [object Object] ,, [object Object] ,, [object Object],"

, instead of the actual ID of the item (s) that is / are equipped and with the following input:

"$ gameVariables.setValue (" variableId ", $ gameActors.actor (" actorId ").
equips ("slotId"). itemId); "

the desired variable has the value 0 even if something is equipped. (Of course the "... Id" are replaced by the corresponding numbers)
please give the actual command you tried to use, without any placeholders - and especially not adding spaces where they don't work at all.
preferably using the code tag of the forum to maintain the code syntax.

There were too many cases where the bug was in one of those "placeholders" and we need to see the code that is actually processed.
I just read that elsewhere, you probably need this line around:

let actor = $gameActors.actor()[y];
$gameVariables.setValue(x, actor.equips()[z].name;

replace "y" with the actor ID (0 is actor leader)
which you can use $gameParrty.leader() as well.

replace x for the variable ID, and Z for the ID of the equipment.

it should be around those lines anyways.
please give the actual command you tried to use, without any placeholders - and especially not adding spaces where they don't work at all.
preferably using the code tag of the forum to maintain the code syntax.

There were too many cases where the bug was in one of those "placeholders" and we need to see the code that is actually processed.

we tried following codes:
$gameVariable.setValue(12,$gameActors.actor(2).equips());
$gameVariable.setValue(12,$gameActors.actor(2).equips().itemId);
the output with them was: ,[object Object],,[object Object],,[object Object],
and with
$gameVariable.setValue(12,$gameActors.actor(2).equips(0));
$gameVariable.setValue(12,$gameActors.actor(2).equips(0).itemId);
the output was 0
when i tired $dataActors.actor(2).equips(0) insead of $gameActors.... i had the desired output of the item id that is equipped on the first slot, but the item on slot 1 will change during the game so i need it from the $game and not from the database

and we don't really know what you min with the code tag of the forum, maybe send us a link of that, thanks
Thanks for your help.
but I found the problem:
it isn't
$gameVariables.setValue(12,$gameActros.actor(2).equips(0).itemId); or
$gameVariables.setValue(12,$gameActros.actor(2).equips()[0].itemId);
instead the command is:
$gameVariables.setValue(12,$gameActros.actor(2).equips()[0].id);
it came to me thanks to ShadowDragon with his .name command

Original thread: https://forums.rpgmakerweb.com/threads/solved-rpg-maker-mv-id-of-the-equipped-items.130080/