I'm not very good with scripts. Can you tell me how to fix this check so that it works?
The script is launch through a regular command in the event.
The script is launch through a regular command in the event.
Ruby:
# Check for the presence of state 46 in any character
members46 = $game_party.actors.select { |actor| actor.states.include?(46) }
$game_party.members.each do |actor|
if actor && actor.state?(46)
# If characters with state_id 46 are found
members46.each do |member|
# Check if the character has skill id_5
unless member.skills.include?(5)
# If there is no skill, add state_id 47
member.add_state(47)
end
end