• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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] Levelcheck script need help

  • 34
    Posts
    9
    Years
    • Seen May 22, 2021
    Hi, as the title says, how do I level check the script without using any switch? (I am intending to use a conditional branch for pbHasLevel? (xx) )

    I tried to use this script but it doesnt work. Am i doing somthing wrong? I also hope that I post this ques in the right thread...

    def pbHasLevel?(level)
    for i in 0...$Trainer.party.length
    return true if $Trainer.party.level >=level
    end
    return false
    end
     
    Where exactly are you using this check. I think pbHasLevel? is an existing method so you don't need to make a new one.

    If its some event the in the 'Script' Command say
    Code:
    for i in 0...$Trainer.party.length
      return true if $Trainer.party[i].level >=level
    end
     
    a simple check level let say to get an item or trigger another event. I am trying to use use for obedience badge, where you hit a certain level in a party, talk to a person to get a badge. And hit another higher level, you get another badge.
     
    Back
    Top