RMMZ Is there a way (script code) to remove all items...

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
2,497
Reaction score
1,192
First Language
French
... from for instance Item ID 25 to 101?
Same question for weapons and armors.
Thanks!
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
3,260
Reaction score
2,535
First Language
Portuguese - Br
Primarily Uses
RMMZ
Hi there!

The script call to lose an item is:
$gameParty.loseItem(item, amount, includeEquip)

So, if you want to remove several items Id:
For progressive Ids:

JavaScript:
for(let id = 25; id <= 101; id++){
    $gameParty.loseItem($dataItems[id], 99, false)
}

For non-progressive ids, you can create an array with the ids you want:

JavaScript:
const ids = [25, 34, 40, 30]

for(const id of ids){
    $gameParty.loseItem($dataItems[id], 99, false)
}

replace $dataItems with $dataWeapons or $dataArmors.
 

Latest Threads

Latest Posts

Latest Profile Posts

YES!!! After hours of work I finally managed to find the perfect balance in combat.
Ok. I am seriously going to make efforts to stop double-posting because I got suspended for two days because of doing it too much. Lmao; am I the only one who got a suspension for this? Probably not, but I'd still like to know LOL.
I always hated when the an NPC disappears for the night they just blink out. Finally got around to making a fade out/in for any NPCs that leave/comeback for the night or day.
LmHbTL.png


Continuing our countdown with Capsule Monster #10 Curl Shot! A powerful ranged attacker, you're better off double teaming him with magic users to defeat!!
TSR
Taking a break from mapping, I've been working on the shop scene lately.Capture d’écran, le 2023-06-09 à 17.18.41.png

Forum statistics

Threads
131,777
Messages
1,223,267
Members
173,547
Latest member
KamiPawa
Top