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

[Error] Erro Can't clone NilClass

help me with this error

---------------------------
Error
---------------------------
Script '[PokeBattle_Pokemon]' line 858: TypeError occurred.

can't clone NilClass

from 'PokeBattle_Pokemon' line 858 in `clone'
from 'PokeBattle_Pokemon' line 858 in `__shadow_clone'
from 'Pokemon_ShadowPokemon' line 336 in `clone'
from '[Poketch_Apps]' line 1840 in `pbPushHistory'
from '[Poketch_Apps]' line 1872 in `calcStats'
from 'PokeBattle_Pokemon' line 636 in `species='
from 'PScreen_Evolution' line 588 in `pbEvolutionSuccess'
from 'PScreen_Evolution' line 564 in `poketch_evolution'
from '[Poketch_Apps]' line 1880 in `pbEvolution'
from 'PItem_ItemEffects' line 363
from 'PItem_ItemEffects' line 360 in `pbFadeOutInWithMusic'
from 'PSystem_Utilities' line 142 in `pbFadeOutIn'
---------------------------
OK
---------------------------


I don't want to use anything about this part of the clones. Help me fix this, either with a solution or deleting a part of the script ...
 
help me with this error

---------------------------
Error
---------------------------
Script '[PokeBattle_Pokemon]' line 858: TypeError occurred.

can't clone NilClass

from 'PokeBattle_Pokemon' line 858 in `clone'
from 'PokeBattle_Pokemon' line 858 in `__shadow_clone'
from 'Pokemon_ShadowPokemon' line 336 in `clone'
from '[Poketch_Apps]' line 1840 in `pbPushHistory'
from '[Poketch_Apps]' line 1872 in `calcStats'
from 'PokeBattle_Pokemon' line 636 in `species='
from 'PScreen_Evolution' line 588 in `pbEvolutionSuccess'
from 'PScreen_Evolution' line 564 in `poketch_evolution'
from '[Poketch_Apps]' line 1880 in `pbEvolution'
from 'PItem_ItemEffects' line 363
from 'PItem_ItemEffects' line 360 in `pbFadeOutInWithMusic'
from 'PSystem_Utilities' line 142 in `pbFadeOutIn'
---------------------------
OK
---------------------------


I don't want to use anything about this part of the clones. Help me fix this, either with a solution or deleting a part of the script ...

Can you post the code of the function def clone in the file PokeBattle_POkemon?
I don't have the same lines as you (line 858 is something else for me).
 
for me it has something to do with it:
https://imgur.com/CP5GwtU

Nah, in fact it's because it's trying to clone @ivMaxed which is not always initialised.
In the clone function of PokeBattle_Pokemon, replace:
Code:
    ret.ivMaxed = @ivMaxed.clone
with
Code:
    ret.ivMaxed = @ivMaxed.clone if @ivMaxed
 
Back
Top