• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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

68
Posts
11
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:

    Telemetius

    Tele*
    267
    Posts
    9
    Years
  • 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