How to see if an item is in the player's inventory by script?

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
2,913
Reaction score
3,948
First Language
English
Primarily Uses
RMMV

I've moved this thread to Learning Ruby and RGSSx. Please be sure to post your threads in the correct forum next time. Thank you.


Just use this: $game_party.has_item?(item). For item you need to paste the item object, not the item id.
 

KaiNormal

Villager
Member
Joined
Apr 4, 2020
Messages
10
Reaction score
0
First Language
PT-BR.
Primarily Uses
RMVXA
Please, give me a example of "item object"? ;-;
 

IneptAttoney_08

Dimas Ridwan AP
Veteran
Joined
Mar 1, 2019
Messages
133
Reaction score
26
First Language
Indonesia
Primarily Uses
RMVXA
you might understand this:
if you may know, why did you make this?
because in the conditional branch process there is already this feature
might tell you why you can make things easier
 

Attachments

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,068
Reaction score
5,691
First Language
Indonesian
Primarily Uses
RMVXA
It's $game_party.has_item?($data_items[10])
 

KaiNormal

Villager
Member
Joined
Apr 4, 2020
Messages
10
Reaction score
0
First Language
PT-BR.
Primarily Uses
RMVXA
you might understand this:
if you may know, why did you make this?
because in the conditional branch process there is already this feature
might tell you why you can make things easier
É para um script que estou fazendo.
 

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
2,913
Reaction score
3,948
First Language
English
Primarily Uses
RMMV

@KaiNormal , please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


Also, all public discussions must be held in English since this is the official RPG Maker English forum. Thank you.

If we have fully answered your question and you have nothing to add to the thread, please report the thread so it can be closed. Click on the "report" button right besides the "edit" button at the bottom of any of your posts in this thread and write "solved" for the reason. Thank you.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I based this on the armor of Actor 1_7 of the RTP. Hair is from Derex and Sythian Bard.
Stream will be live shortly! Going to do another art stream tonight so that I can finish my Fauna Focus piece~ Feel free to drop by!
Humans are fallible creatures, we all know that. It's when we're forced to look at ourselves that we start to disagree. :p
Expectation: Working on boss battle.
Reality: "Look at how awful are these code and database organization. Let me clean this mess", *yet, casually adding more modules that I have no idea if I would use it later*
Trying to learn to read Japanese so I read my manga. I like to buy them without all the edits made during translation.

Forum statistics

Threads
97,864
Messages
947,450
Members
129,087
Latest member
jubacard
Top