if Actor has Accessory/Head/Body Armor "Equipped" and "Unequipped"

coboldRPG

Villager
Member
Joined
Mar 5, 2020
Messages
5
Reaction score
0
First Language
RGSS
Primarily Uses
RMXP
I want to ask, a script to call "if Actor has Accessory/Head/Body Armor "Equipped" and "Unequipped" ?

when i try this, the error is "undefined 'equips' for nilClass"
$game_party.actors[0].equips.include?($data_weapons)

thank you
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,413
Reaction score
12,947
First Language
English
Primarily Uses
RMMV
$data_weapons is an array containing all of the weapons. An actor cannot have an array equipped. Also, why are you using $data_weapons if you want to know if armor is equipped?

Are you just checking to see if SOMETHING is equipped? So you want to know if the actor has an accessory, head armor and body armor equipped or is missing something in one or more slots?

actor.armor1_id is the shield
actor.armor2_id is the helmet
actor.armor3_id is the body armor
actor.armor4_id is the accessory

So if you just want to know if they have something there, it would be:

Code:
$game_party.actors[0].armor2_id != nil && $game_party.actors[0].armor3_id != nil && $game_party.actors[0].armor4_id != nil
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Karen: Hi, I have a condition that prevents me from wearing a mask. :)

Employee: Can you tell me what it is?

Karen: >:(
Feeling a little overwhelmed... There are so many things to do.
- Building a simple website for portfolio
- Setup *******
- Manage social media
There are so many things inside of these tasks :(
Meet the cute little ghost, FhooFhoo. :kaopride:
If anyone here is looking for another high-potential RPGMaker game--besides She Dreams Elsewhere--be sure to follow Lawmage Academy. Good social media presence will take that game far.
Lol, I was about to write a small tutorial and realized it would belong to the MZ section ....that does not exist yet.

Forum statistics

Threads
99,576
Messages
966,839
Members
131,233
Latest member
Mzar
Top