Skip to content

Instantly share code, notes, and snippets.

@triacontane
Created June 11, 2023 12:32
Show Gist options
  • Save triacontane/eee097a5ab7e08b23530acd9802b8b66 to your computer and use it in GitHub Desktop.
Save triacontane/eee097a5ab7e08b23530acd9802b8b66 to your computer and use it in GitHub Desktop.
所持している武器と防具をすべて売却する
var allItems = $gameParty.allItems();
for (var i = 0; i < allItems.length; i++) {
var item = allItems[i];
if (DataManager.isWeapon(item) || DataManager.isArmor(item)) {
var num = $gameParty.numItems(item);
var price = Math.floor(item.price / 2);
$gameParty.gainGold(price * num);
$gameParty.loseItem(item, num);
}
}
@triacontane
Copy link
Author

ChatGPT-4に作って貰いました。
image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment