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,921
Reaction score
3,950
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,076
Reaction score
5,695
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,921
Reaction score
3,950
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

Playtesting for Battle Castle is done, demo time for me was roughly 6 hours and 20 minutes. I'm going to pass it on to a few friends first, and after getting some feedback will be posting an official topic.
There's another Humble Bundle available now for RPG developer assets, this time focused somewhat more towards pixel art style games.
Ive got a long lost half uncle. Thats real cool.
I forget what is bumping rule in this forum. Is anyone know? Thank you.
BCj
Ew, why does my blogpost on the rpgmaker.net site look like a garbled mess? Are html codes disabled or something?

Forum statistics

Threads
97,902
Messages
947,745
Members
129,145
Latest member
PokeeyXD
Top