解决了
![[酷]](/static/emoticons/u9177.png)
顺便问一下#判断是否持有物品(装备)的脚本要怎么理解
$gameActors.actor(actor_id).equips()[slot_id] == null;
*change null to id
——————
# 检查条件分支:如果[演员]有[武器]装备
# ----------------------------------------------
$game_actors[actor id].weapons.include?($data_weapons[weapon id])
right_hand = $game_actors[actor_id].equips[0]
left_hand = $game_actors[actor_id].equips[1]
#获取项目,替换你要找的装备的索引:
# 0 = right hand, 1 = left hand, 2 = head, 3 = body, 4 = accessory
# provided you're not using any scripts that change that. You can check their types with:
if right_hand.is_a?(RPG::Weapon)
# do something
elsif right_hand.is_a?(RPG::Armor)
# do something else
end
# Or get their properties with with:
right_hand.id
right_hand.name
right_hand.icon_index
right_hand.description
# etc..
# Example: if you want to check if you have a Prinny Gun equipped on your first weapon slot:
right_hand = $game_actors[actor_id].equips[0]
if !right_hand.nil? && right_hand.name.eql?("Prinny Gun")
# Do something
end
# You don't even need to keep track of the IDs, really (unless you want to, for some reason).
# If there's no way to not have a weapon equipped in your game, you can also take out the ".nil?" check.