• 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!
  • 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] Set wild Pokémon as Shiny

  • 773
    Posts
    14
    Years
    • UK
    • Seen Dec 29, 2024
    Set a wild Pokémon as a guaranteed shiny but get the below error
    undefined method `shiny' for #<Pokemon RATTATA Lv.5>

    The code I'm trying is

    Code:
    Events.onWildPokemonCreate+=proc {|sender,e|
       pokemon=e[0]
       pokemon.shiny if $game_switches[107]
    }
     
    Last edited:
    Your code is wrong. It should be
    Code:
    pokemon.shiny = true if $game_switches[107]

    Alternative, you could just use the SHINY_WILD_POKEMON_SWITCH already implemented in Essentials by default. You can get the ID number for that switch in the Settings script section.
     
    Back
    Top