• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] WIld Encounters always flee

  • 66
    Posts
    12
    Years
    • Seen Nov 12, 2023
    Is it possible to have a Switch that, when activated, makes all wild Pokémon flees as soon as possible?
     
    Last edited by a moderator:
    Yeah you can paste this:

    Code:
        if [email protected] && @battle.pbIsOpposing?(self.index) && @battle.pbCanRun?(self.index) && $game_switches[XXX]
          pbBeginTurn(choice)
          @battle.pbDisplay(_INTL("{1} run!",self.pbThis))
          @battle.decision=3
          pbEndTurn(choice)
          return true
        end

    after:

    Code:
    def pbProcessTurn(choice)
        # Can't use a move if fainted
        return false if self.isFainted?

    I haven't tested it but it'd the same code as the roaming pokémon. It just works only if your switch XXX is on. Just remember to change XXX into an actual number.
     
    Back
    Top