Is there an easier way to optimize this code? The code checks if the player's equipment slots is not nil. I have different methods in each condition, but just in case there's a way to optimize it, please do tell.
$game_party.members.each do |player| if !player.equips[0].nil? if $game_system.get_money end end if !player.equips[1].nil? if $game_system.get_money end end if !player.equips[2].nil? if $game_system.get_money end end if !player.equips[3].nil? if $game_system.get_money end end if !player.equips[4].nil? if $game_system.get_money end end endI mean making if statement for each equipment seems to be a very noob move.
$game_party.members.each do |player| if !player.equips[0].nil? if $game_system.get_money end end if !player.equips[1].nil? if $game_system.get_money end end if !player.equips[2].nil? if $game_system.get_money end end if !player.equips[3].nil? if $game_system.get_money end end if !player.equips[4].nil? if $game_system.get_money end end endI mean making if statement for each equipment seems to be a very noob move.