• 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!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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] BGM not changing

  • 76
    Posts
    9
    Years
    • Seen Dec 9, 2022
    Hey guys, I want to include something specific within a move. First time the move is used a music changes to A but after the second time using the move I want that the music changes to B. However, even using the if-else function, the music do not change. Why is that?

    ################################################################################
    # Auraburst
    ################################################################################
    class PokeBattle_Move_170 < PokeBattle_Move
    def pbEffectAfterHit(attacker,opponent,turneffects)
    if isConst?(@id,PBMoves,:AURABURST)
    if isConst?(attacker.species,PBSpecies,:GRENINJA) &&
    !attacker.effects[PBEffects::Transform] &&
    !(attacker.hasWorkingAbility(:SHEERFORCE) && self.addlEffect>0) &&
    !attacker.isFainted?
    if pbBGMPlay("Dragon Ball Super - Goku VS Jiren Theme",100,100)
    pbBGMPlay("8-Bit Boss Battle 4 - By EliteFerrex",100,100)
    else
    pbBGMPlay("Dragon Ball Super - Goku VS Jiren Theme",100,100)
    end

    attacker.form=attacker.form+10
    attacker.pbIncreaseStat(PBStats::ATTACK,3,attacker,false,self)
    attacker.pbIncreaseStat(PBStats::DEFENSE,3,attacker,false,self)
    attacker.pbIncreaseStat(PBStats::SPATK,3,attacker,false,self)
    attacker.pbIncreaseStat(PBStats::SPDEF,3,attacker,false,self)
    attacker.pbIncreaseStat(PBStats::SPEED,3,attacker,false,self)
    attacker.pbUpdate(true)
    u/battle.scene.pbChangePokemon(attacker,attacker.pokemon)
    u/battle.pbDisplay(_INTL("{1}'s hidden potential got unlocked!",attacker.pbThis))
    PBDebug.log("[Form changed] #{attacker.pbThis} changed to form #{attacker.form}")
    return 0
    end
    end
    end
    end
     
    Back
    Top