ItemHandlers::BattleUseOnBattler.add(:POKEDOLL,proc{|item,battler,scene|
battle=battler.battle
if battle.opponent
scene.pbMessage(_INTL("Can't use that here."))
return false
else
playername=battle.pbPlayer.name
itemname=PBItems.getName(item)
scene.pbDisplay(_INTL("{1} used the {2}.",playername,itemname))
return true
end
})
ItemHandlers::BattleUseOnBattler.copy(:POKEDOLL,:FLUFFYTAIL,:POKETOY)
ItemHandlers::BattleUseOnBattler.add(:YOURITEM,proc{|item,battler,scene|
battle=battler.battle
playername=battle.pbPlayer.name
itemname=PBItems.getName(item)
scene.pbDisplay(_INTL("{1} used the {2}.",playername,itemname))
return true
end
})
ItemHandlers::BattleUseOnBattler.add(:POKEDOLL,proc{|item,battler,scene|
battle=battler.battle
if battle.opponent
scene.pbDisplay(_INTL("Can't use that here."))
return false
else
playername=battle.pbPlayer.name
itemname=PBItems.getName(item)
scene.pbDisplay(_INTL("{1} used the {2}.",playername,itemname))
return true
end
})
ItemHandlers::BattleUseOnBattler.add(:FLUCHTSTEIN,proc{|item,battler,scene|
battle=battler.battle
playername=battle.pbPlayer.name
itemname=PBItems.getName(item)
scene.pbDisplay(_INTL("{1} used the {2}.",playername,itemname))
return true
end
})
can you help me to find my failure?532,FLUCHTSTEIN,FLUCHTSTEIN,8,9900,Mit diesen Stein kannst du flüchten wenn du ein Trainer Pokemon gefangen hast.,0,2,6,
Thank you but i doesnt work for me i get syntax error and i dont know why ... here is my code:
PokemonItemEffects
and here the items.txt
can you help me to find my failure?
EDIT: Sorry im new in this only try to learn it plz help me :)
ItemHandlers::BattleUseOnBattler.add(:FLUCHTSTEIN,proc{|item,battler,scene|
battle=battler.battle
if battle.opponent
scene.pbMessage(_INTL("Can't use that here."))
return false
else
playername=battle.pbPlayer.name
itemname=PBItems.getName(item)
scene.pbDisplay(_INTL("{1} used the {2}.",playername,itemname))
return true
end
})
ItemHandlers::BattleUseOnBattler.copy(:POKEDOLL,:FLUCHTSTEIN)
The syntax error was in Masters script that you copied
Or you could use the easier route
Code:ItemHandlers::BattleUseOnBattler.copy(:POKEDOLL,:FLUCHTSTEIN)
ItemHandlers::BattleUseOnBattler.add(:FLUCHTSTEIN,proc{|item,battler,scene|
battle=battler.battle
if [COLOR="Red"]![/COLOR]battle.opponent
scene.pbMessage(_INTL("Can't use that here."))
return false
else
playername=battle.pbPlayer.name
itemname=PBItems.getName(item)
scene.pbDisplay(_INTL("{1} used the {2}.",playername,itemname))
return true
end
})
Except I think he wants an item that allows him to flee a Trainer Battle (seems odd to me, but whatever). Which means the proper code is this: