[MZ] How to get actor equipment ID?

Hi.
I want to know what is the variable ID of Actor equipment, something like...
Weapon ID from actor leader.
Someone knows?
And also, how to force the hero unequip respective equipment.
To get the ID of the equip:
Code:
$gameActors.actor(a).equips()[x].id

To remove the slot equip:
Code:
$gameActors.actor(a).changeEquipById(x)

a = actor index
x = equip slot index
To get the ID of the equip:
Code:
$gameActors.actor(a).equips()[x].id

To remove the slot equip:
Code:
$gameActors.actor(a).changeEquipById(x)

a = actor index
x = equip slot index
Thanks bro!!
To get the ID of the equip:
Code:
$gameActors.actor(a).equips()[x].id

To remove the slot equip:
Code:
$gameActors.actor(a).changeEquipById(x)

a = actor index
x = equip slot index
I put
1652480736006.png

but is showing me number 3, idk why, because i dont have equipments
Can you show me your character's equip screen, and your armor database?
also, equips()[1] is your 2nd slot(shield).
Can you show me your character's equip screen, and your armor database?
also, equips()[1] is your 2nd slot(shield).
1652483897749.png

1652483917806.png
Do you start with a shield, then remove it?
I don't think your setup will work correctly.
if there is no equip, it will return null. if you already changed variable.. it will remain as it last was.

Code:
if ($gameActors.actor(1).equips()[1] == null) {
$gameVariables.setValue(1, 0)
}
else {
$gameVariables.setValue(1, $gameActors.actor(1).equips()[1].id);
}

Use this script instead of control variables.
W
Do you start with a shield, then remove it?
I don't think your setup will work correctly.
if there is no equip, it will return null. if you already changed variable.. it will remain as it last was.

Code:
if ($gameActors.actor(1).equips()[1] == null) {
$gameVariables.setValue(1, 0)
}
else {
$gameVariables.setValue(1, $gameActors.actor(1).equips()[1].id);
}

Use this script instead of control variables.
Worked!! thank u som much!
Welcome, m8

Original thread: https://forums.rpgmakerweb.com/threads/mz-how-to-get-actor-equipment-id.147540/