Just beat the first gym and after getting on the train I get an error which says
Script Pokémon Encounters line 331: NoMethodError occurred.
Undefined method blackFluteUsed for nil:NilClass
I think it happens whenever I run into a wild Pokémon but regardless does anyone know what the problem is and how to fix it?