Hello There, Guest! Login Register


guys help with "adding capture" pokemon to this scrip
#1
hey guys, noob question (dont know nothing about programming)

i want to add the function capture lapras to this script, how should it looks when its done??? (its the default leveling script of route 21 of silver)

sorry my bad english im not a native speaker


name = "Leveling: Route 21 (near Cinnabar)"
author = "Silv3r"
description = [[This script will train the first pokémon of your team.
It will also try to capture shinies by throwing pokéballs.
Start anywhere between Cinnabar Island and Route 21.
You need a pokémon with surf.]]

function onPathAction()
if isPokemonUsable(1) then
if getMapName() == "Pokecenter Cinnabar" then
moveToMap("Cinnabar Island")
elseif getMapName() == "Cinnabar Island" then
moveToMap("Route 21")
elseif getMapName() == "Route 21" then
moveToWater()
end
else
if getMapName() == "Route 21" then
moveToMap("Cinnabar Island")
elseif getMapName() == "Cinnabar Island" then
moveToMap("Pokecenter Cinnabar")
elseif getMapName() == "Pokecenter Cinnabar" then
usePokecenter()
end
end
end

function onBattleAction()
if isWildBattle() and isOpponentShiny() then
if useItem("Ultra Ball") or useItem("Great Ball") or useItem("Pokeball") then
return
end
end
if getActivePokemonNumber() == 1 then
return attack() or run() or sendUsablePokemon() or sendAnyPokemon()
else
return run() or attack() or sendUsablePokemon() or sendAnyPokemon()
end
end
 
Reply
#2
function onBattleAction()


if isWildBattle() and (isOpponentShiny() or getOpponentName() == "Lapras"  ) then
        return useItem("Pokeball") or useItem("Great Ball") or useItem("Ultra Ball") or sendUsablePokemon()
    end

if getActivePokemonNumber() > 5 then
            return run()
    else return attack() or sendUsablePokemon() or sendAnyPokemon()    or run()
        end
end

This battle function catch any shiny and any lapras and train five poke in your team
 
Reply
#3
thx
 
Reply
#4
17:06:55] Could not load script Route21 - Cinnabar.lua:
chunk_1Sad34,75-76): unexpected symbol near ')'
[17:07:01] System: You are now AFK!

that is what happend when i put your txt on the script, did i did something wrong?
 
Reply
#5
My battle function is working for me : post your full script and your BBcode for it pls
 
Reply
#6
oh, i guess i corrected thx =D
 
Reply
#7
No problem Smile
 
Reply
  


Forum Jump:


Browsing: 1 Guest(s)