I have started to work on a code for the player to animate (hold pokeball in the air like in gen 4 & 5) when he/she uses a HM, i've started on cut and I get a syntax error.. i figured this code would work.. what am i doing wrong? sorry i am new to scripting.. i will also need a script to use a different image for the female character.
heres the code:
Cheers.
heres the code:
Code:
#===============================================================================
# Cut
#===============================================================================
def Kernel.pbCut
if $DEBUG ||
(HIDDENMOVESCOUNTBADGES ? $Trainer.numbadges>=BADGEFORCUT : $Trainer.badges[BADGEFORCUT])
movefinder=Kernel.pbCheckMove(:CUT)
if $DEBUG || movefinder
Kernel.pbMessage(_INTL("This tree looks like it can be cut down!\1"))
if Kernel.pbConfirmMessage(_INTL("Would you like to cut it?"))
speciesname=!movefinder ? $Trainer.name : movefinder.name
Kernel.pbMessage(_INTL("{1} used Cut!",speciesname))
pbMoveRoute($game_player,[
PBMoveRoute::Graphic - "trchar000cut', 0, 2, 0
pbWait(4)
PBMoveRoute::Graphic - "trchar000cut', 0, 2, 1
pbWait(4)
PBMoveRoute::Graphic - "trchar000cut', 0, 2, 2
pbWait(4)
PBMoveRoute::Graphic - "trchar000cut', 0, 2, 3
pbWait(20)
])
pbHiddenMoveAnimation(movefinder)
return true
end
else
Kernel.pbMessage(_INTL("This tree looks like it can be cut down."))
end
else
Kernel.pbMessage(_INTL("This tree looks like it can be cut down."))
end
return false
end
HiddenMoveHandlers::CanUseMove.add(:CUT,proc{|move,pkmn|
if !$DEBUG &&
!(HIDDENMOVESCOUNTBADGES ? $Trainer.numbadges>=BADGEFORCUT : $Trainer.badges[BADGEFORCUT])
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
facingEvent=$game_player.pbFacingEvent
if !facingEvent || facingEvent.name!="Tree"
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
})
HiddenMoveHandlers::UseMove.add(:CUT,proc{|move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
facingEvent=$game_player.pbFacingEvent
if facingEvent
facingEvent.erase
$PokemonMap.addErasedEvent(facingEvent.id)
end
return true
})
Last edited: