• 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.

[Eventing Question] Remove all Pokémon from party

7
Posts
5
Years
    • Seen Dec 12, 2018
    Hello guys!

    I'm trying to make an event in which I receive a Pokémon to catch another 3... After that, I want to remove all of them from the party (so I'll have no Pokémon left).

    Does anyone know a way to do it?
     

    Poq

    144
    Posts
    6
    Years
    • Seen Aug 28, 2021
    The script $Trainer.party.delete_at(index), where "index" is the spot in the player's party, will let you delete even the player's last able pok?mon.
    You could set up the script as:
    Code:
    for i in 0...$Trainer.party.length
         $Trainer.party.delete_at(i)
    That should do it.
     
    Last edited:
    7
    Posts
    5
    Years
    • Seen Dec 12, 2018
    The script $Trainer.party.delete_at(index), where "index" is the spot in the player's party, will let you delete even the player's last able pok?mon.
    You could set up the script as:
    Code:
    for i in 0...$Trainer.party.length
         $Trainer.party.delete_at(i)
    That should do it.

    Basically, I'll have to create a new script line on the script section and put the code, than I'd have to to call it on the event?
    I'm not so good at scripting so, I don't know if I got it right.
    if you could send my pictures, it'd help me a lot!
     

    Poq

    144
    Posts
    6
    Years
    • Seen Aug 28, 2021
    Basically, I'll have to create a new script line on the script section and put the code, than I'd have to to call it on the event?

    No, you can use the script I just wrote in the event. If you haven't added a script like to an event before, it's the very last option on the third tab.
     
    7
    Posts
    5
    Years
    • Seen Dec 12, 2018
    No, you can use the script I just wrote in the event. If you haven't added a script like to an event before, it's the very last option on the third tab.

    Thanks for the help! It's working great.
    xD
     
    • Like
    Reactions: Poq
    Back
    Top