• 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] Prevent Player from Capturing Pokémon!

33
Posts
6
Years
Prevent Player from Capturing Pok?mon!

How can I prevent the player from capturing or using Pokeballs on certain maps?
 
971
Posts
7
Years
  • Age 21
  • Seen Nov 28, 2022
In the PokeBattle_Battle script, find this piece of code (lines 61 - 64 in a clean project if I'm not mistaken)
Code:
    if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
      @scene.pbThrowAndDeflect(ball,1)
      pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
    else

Change it to this:
Code:
    if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
      @scene.pbThrowAndDeflect(ball,1)
      pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
    elsif MAPSCANNOTUSEPOKEBALLS.include?($game_map.map_id)
      @scene.pbThrowAndDeflect(ball,1)
      pbDisplay(_INTL("You cannot use Poké Balls here!"))
    else


In your Settings script at the very top, add this:
Code:
MAPSCANNOTUSEPOKEBALLS = [1,2,3,4]

These numbers, 1,2,3,4 are the Map IDs on which you cannot use Poké Balls.
 
Back
Top