Ir para conteúdo

Catch.lua


Gkz

Posts Recomendados

editei o catch.lua do pokemon e deu esse erro

 

[20/03/2011 22:06:38] [Error - LuaScriptInterface::loadFile] data/actions/scripts/catch.lua:22: '}' expected (to close '{' at line 1) near '['
[20/03/2011 22:06:38] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/catch.lua)
[20/03/2011 22:06:38] data/actions/scripts/catch.lua:22: '}' expected (to close '{' at line 1) near '['

 

Ai o Script

local pokes = {
["Magikarp"] = {chance = 2, corpse = 2818, health = 120, maxhealth = 120},
["Exeggcute"] = {chance = 50, corpse = 2982, health = 1076, maxhealth = 1076},
["Exeggutor"] = {chance = 85, corpse = 3005, health = 120, maxhealth = 120},
["Tangela"] = {chance = 73, corpse = 5976, health = 2097, maxhealth = 2097},
["Gastly"] = {chance = 65, corpse = 5993, health = 1076, maxhealth = 1076},
["Haunter"] = {chance = 73, corpse = 6004, health = 120, maxhealth = 120},
["Gengar"] = {chance = 87, corpse = 6336, health = 2097, maxhealth = 2097},
["Caterpie"] = {chance = 10, corpse = 5971, health = 2500, maxhealth = 2500},
["Metapod"] = {chance = 44, corpse = 5970, health = 250, maxhealth = 250},
["Butterfree"] = {chance = 80, corpse = 5985, health = 823, maxhealth = 823},
["Bulbasaur"] = {chance = 75, corpse = 6039, health = 271, maxhealth = 271},
["Ivysaur"] = {chance = 85, corpse = 6340, health = 2758, maxhealth = 2758},
["Venusaur"] = {chance = 95, corpse = 2973, health = 300, maxhealth = 300},
["Goldeen"] = {chance = 29, corpse = 2970, health = 250, maxhealth = 250},
["Seaking"] = {chance = 77, corpse = 3038, health = 823, maxhealth = 823},
["Staryu"] = {chance = 58, corpse = 5987, health = 399, maxhealth = 399},
["Starmie"] = {chance = 87, corpse = 7320, health = 1076, maxhealth = 1076},
["Gyarados"] = {chance = 79, corpse = 6331, health = 2097, maxhealth = 2097},
["Lapras"] = {chance = 80, corpse = 6018, health = 7000, maxhealth = 7000},
["Vaporeon"] = {chance = 69, corpse = 5960, health = 4500, maxhealth = 4500}
["Tentacool"] = {chance = 35, corpse = 2961, health = 725, maxhealth = 725},
["Tentacruel"] = {chance = 72, corpse = 6037, health = 10100, maxhealth = 10100},
["Slowpoke"] = {chance = 41, corpse = 2926, health = 350, maxhealth = 350},
["Slowbro"] = {chance = 77, corpse = 5986, health = 950, maxhealth = 950},
["Krabby"] = {chance = 30, corpse = 6039, health = 271, maxhealth = 271},
["Kingler"] = {chance = 60, corpse = 6340, health = 2758, maxhealth = 2758},
["Wartortle"] = {chance = 85, corpse = 5978, health = 2300, maxhealth = 2300},
["Blastoise"] = {chance = 95, corpse 5999, health = 9000, maxhealth = 9000},
["Psyduck"] = {chance = 60, corpse = 6029, health = 330, maxhealth = 330},
["Golduck"] = {chance = 80, corpse = 6028, health = 3880, maxhealth = 3880},
["Squirtle"] = {chance = 75, corpse = 6008, health = 650, maxhealth = 650},
["Abra"] = {chance = 59, corpse = 2905, health = 620, maxhealth = 620},
["Kadabra"] = {chance = 142, corpse = 6060, health = 2500, maxhealth = 2500},
["Alakazam"] = {chance = 241, corpse = 6057, health = 2500, maxhealth = 2500},
["Rattata"] = {chance = 8, corpse = 5974, health = 350, maxhealth = 350},
["Raticate"] = {chance = 16, corpse = 6007, health = 900, maxhealth = 900},
["Pidgey"] = {chance = 11, corpse = 5961, health = 380, maxhealth = 380},
["Pidgeotto"] = {chance = 26, corpse = 5966, health = 1400, maxhealth = 1400},
["Pidgeot"] = {chance = 167, corpse = 6020, health = 3800, maxhealth = 3800},
["Zubat"] = {chance = 15, corpse = 5989, health = 450, maxhealth = 450},
["Golbat"] = {chance = 53, corpse = 6053, health = 1900, maxhealth = 1900},
["Bellsprout"] = {chance = 13, corpse = 2806, health = 420, maxhealth = 420},
["Weepinbell"] = {chance = 28, corpse = 2928, health = 1100, maxhealth = 1100},
["Victreebel"] = {chance = 140, corpse = 6332, health = 4000, maxhealth = 4000},
["Poliwag"] = {chance = 8, corpse = 6042, health = 400, maxhealth = 400},
["Poliwhirl"] = {chance = 29, corpse = 6054, health = 1200, maxhealth = 1200},
["Poliwrath"] = {chance = 186, corpse = 6033, health = 4400, maxhealth = 4400},
["Oddish"] = {chance = 7, corpse = 3008, health = 340, maxhealth = 340},
["Gloom"] = {chance = 25, corpse = 6017, health = 1400, maxhealth = 1400},
["Vileplume"] = {chance = 133, corpse = 6025, health = 3300, maxhealth = 3300},
["Horsea"] = {chance = 10, corpse = 2973, health = 300, maxhealth = 300},
["Seadra"] = {chance = 87, corpse = 2872, health = 2500, maxhealth = 2500},
["Grimer"] = {chance = 14, corpse = 6055, health = 600, maxhealth = 600},
["Weedle"] = {chance = 3, corpse = 5964, health = 325, maxhealth = 325},
["Kakuna"] = {chance = 18, corpse = 6000, health = 900, maxhealth = 900},
["Beedrill"] = {chance = 40, corpse = 5990, health = 1900, maxhealth = 1900},
["Muk"] = {chance = 55, corpse = 2845, health = 2400, maxhealth = 2400},
["Doduo"] = {chance = 16, corpse = 2842, health = 600, maxhealth = 600},
["Dodrio"] = {chance = 79, corpse = 6047, health = 2650, maxhealth = 2650},
["Magnemite"] = {chance = 19, corpse = 6056, health = 450, maxhealth = 450},
["Magneton"] = {chance = 70, corpse = 6076, health = 1750, maxhealth = 1750},
["Voltorb"] = {chance = 13, corpse = 6049, health = 620, maxhealth = 620},
["Electrode"] = {chance = 60, corpse = 6051, health = 2000, maxhealth = 2000},
["Geodude"] = {chance = 17, corpse = 6071, health = 700, maxhealth = 700},
["Graveler"] = {chance = 105, corpse = 6516, health = 3000, maxhealth = 3000},
["Golem"] = {chance = 205, corpse = 6043, health = 6500, maxhealth = 6500},
["Sandshrew"] = {chance = 16, corpse = 5988, health = 700, maxhealth = 700},
["Paras"] = {chance = 43, corpse = 3007, health = 250, maxhealth = 250},
["Parasect"] = {chance = 83, corpse = 6027, health = 823, maxhealth = 823},
["Scyther"] = {chance = 88, corpse = 3002, health = 823, maxhealth = 823},
["Pinsir"] = {chance = 89, corpse = 7282, health = 399, maxhealth = 399},
["Sandslash"] = {chance = 160, corpse = 6041, health = 3400, maxhealth = 3400},
["Vulpix"] = {chance = 10, corpse = 6003, health = 2500, maxhealth = 2500},
["Ninetales"] = {chance = 44, corpse = 6040, health = 250, maxhealth = 250},
["Charmander"] = {chance = 20, corpse = 5983, health = 970, maxhealth = 970},
["Charmeleon"] = {chance = 73, corpse = 5981, health = 2900, maxhealth = 2900},
["Charizard"] = {chance = 261, corpse = 6005, health = 5200, maxhealth = 5200},
}

local description = "Contains a %pokename."

function onUse(cid, item, frompos, item2, topos)
local name = getItemNameById(item2.itemid)
if item.itemid == 2147 then
catchrate = 1
oncatch = 24
onfail = 23
bolabola = 2222
elseif item.itemid == 2146 then
catchrate = 4
oncatch = 200
onfail = 199
bolabola = 2220
end
local rate = (catchrate)
local catch = oncatch
local fail = onfail
local newid = bolabola
for i,x in pairs(pokes) do
if getItemNameById(item2.itemid):find(i:lower()) then
if getItemIdByName(name) == pokes[i].corpse then
if cid ~= getItemAttribute(item2.uid, "corpseowner") and isInArray({1,8}, getPlayerGroupId(cid)) then
doPlayerSendCancel(cid, "You are not allowed to catch this pokemon.")
return true
end
doRemoveItem(item.uid, 1)
doRemoveItem(item2.uid, 1)
local pegar = math.random(0, x.chance)
if pegar <= 1*(rate) then
doSendMagicEffect(topos, catch)

local nas = {
["%%pokename"] = i
}
for i,x in pairs(nas) do
if description:find(i) then
description = description:gsub(i, x)
end
end

local function capturou(params)
if not isCreature(params.cid) then
return true
end
if not string.find(getPlayerStorageValue(cid, 54842), ""..i..",") then
doPlayerAddSoul(cid, 1)
setPlayerStorageValue(cid, 54842, getPlayerStorageValue(cid, 54842)..""..i..", ")
end
if getPlayerFreeCap(cid) <= 0.99 then
item = doCreateItemEx(newid-1)
doItemSetAttribute(item, "poke", params.poke)
doItemSetAttribute(item, "nome", params.nome)
doItemSetAttribute(item, "description", params.description)
doPlayerSendMailByName(getCreatureName(params.cid), item, 1)
doPlayerSendTextMessage(cid, 27, "Congratulations, you caught a "..i.."!")
doPlayerSendTextMessage(cid, 27, "Since you are already holding six pokemons, this pokeball has been sent to your depot.")
else
item = doCreateItemEx(params.ball)
doItemSetAttribute(item, "poke", params.poke)
doItemSetAttribute(item, "nome", params.nome)
doItemSetAttribute(item, "description", params.description)
doPlayerAddItemEx(params.cid, item, true)
doTransformItem(item, newid)
doPlayerSendTextMessage(cid, 27, "Congratulations, you caught a "..i.."!")
end
if #getCreatureSummons(cid) >= 1 then
doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 178)
else
doSendMagicEffect(getThingPos(cid), 178)
end
end

local description = "Contains a "..i.."."
local poke1 = "This is "..i.."'s pokeball. HP = ["..x.health.."/"..x.maxhealth.."]"
addEvent(capturou, 4000, {cid = cid, poke = poke1, nome = i, description = description, ball = 2219, letter = 2597})
else
function ruim(params)
if not isCreature(params.cid) then
return true
end
doPlayerSendTextMessage(params.cid, 27, "Sorry, you didn\'t catch that pokemon.")
if #getCreatureSummons(params.cid) >= 1 then
doSendMagicEffect(getThingPos(getCreatureSummons(params.cid)[1]), 166)
else
doSendMagicEffect(getThingPos(params.cid), 166)
end
end
addEvent(ruim, 4000, {cid = cid})
doSendMagicEffect(topos, fail)
end
end
end
end
return TRUE
end

 

O que ta dano erro?

Link para o comentário
Compartilhar em outros sites

editei o catch.lua do pokemon e deu esse erro

 

[20/03/2011 22:06:38] [Error - LuaScriptInterface::loadFile] data/actions/scripts/catch.lua:22: '}' expected (to close '{' at line 1) near '['
[20/03/2011 22:06:38] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/catch.lua)
[20/03/2011 22:06:38] data/actions/scripts/catch.lua:22: '}' expected (to close '{' at line 1) near '['

 

Ai o Script

local pokes = {
["Magikarp"] = {chance = 2, corpse = 2818, health = 120, maxhealth = 120},
["Exeggcute"] = {chance = 50, corpse = 2982, health = 1076, maxhealth = 1076},
["Exeggutor"] = {chance = 85, corpse = 3005, health = 120, maxhealth = 120},
["Tangela"] = {chance = 73, corpse = 5976, health = 2097, maxhealth = 2097},
["Gastly"] = {chance = 65, corpse = 5993, health = 1076, maxhealth = 1076},
["Haunter"] = {chance = 73, corpse = 6004, health = 120, maxhealth = 120},
["Gengar"] = {chance = 87, corpse = 6336, health = 2097, maxhealth = 2097},
["Caterpie"] = {chance = 10, corpse = 5971, health = 2500, maxhealth = 2500},
["Metapod"] = {chance = 44, corpse = 5970, health = 250, maxhealth = 250},
["Butterfree"] = {chance = 80, corpse = 5985, health = 823, maxhealth = 823},
["Bulbasaur"] = {chance = 75, corpse = 6039, health = 271, maxhealth = 271},
["Ivysaur"] = {chance = 85, corpse = 6340, health = 2758, maxhealth = 2758},
["Venusaur"] = {chance = 95, corpse = 2973, health = 300, maxhealth = 300},
["Goldeen"] = {chance = 29, corpse = 2970, health = 250, maxhealth = 250},
["Seaking"] = {chance = 77, corpse = 3038, health = 823, maxhealth = 823},
["Staryu"] = {chance = 58, corpse = 5987, health = 399, maxhealth = 399},
["Starmie"] = {chance = 87, corpse = 7320, health = 1076, maxhealth = 1076},
["Gyarados"] = {chance = 79, corpse = 6331, health = 2097, maxhealth = 2097},
["Lapras"] = {chance = 80, corpse = 6018, health = 7000, maxhealth = 7000},
["Vaporeon"] = {chance = 69, corpse = 5960, health = 4500, maxhealth = 4500}
["Tentacool"] = {chance = 35, corpse = 2961, health = 725, maxhealth = 725},
["Tentacruel"] = {chance = 72, corpse = 6037, health = 10100, maxhealth = 10100},
["Slowpoke"] = {chance = 41, corpse = 2926, health = 350, maxhealth = 350},
["Slowbro"] = {chance = 77, corpse = 5986, health = 950, maxhealth = 950},
["Krabby"] = {chance = 30, corpse = 6039, health = 271, maxhealth = 271},
["Kingler"] = {chance = 60, corpse = 6340, health = 2758, maxhealth = 2758},
["Wartortle"] = {chance = 85, corpse = 5978, health = 2300, maxhealth = 2300},
["Blastoise"] = {chance = 95, corpse 5999, health = 9000, maxhealth = 9000},
["Psyduck"] = {chance = 60, corpse = 6029, health = 330, maxhealth = 330},
["Golduck"] = {chance = 80, corpse = 6028, health = 3880, maxhealth = 3880},
["Squirtle"] = {chance = 75, corpse = 6008, health = 650, maxhealth = 650},
["Abra"] = {chance = 59, corpse = 2905, health = 620, maxhealth = 620},
["Kadabra"] = {chance = 142, corpse = 6060, health = 2500, maxhealth = 2500},
["Alakazam"] = {chance = 241, corpse = 6057, health = 2500, maxhealth = 2500},
["Rattata"] = {chance = 8, corpse = 5974, health = 350, maxhealth = 350},
["Raticate"] = {chance = 16, corpse = 6007, health = 900, maxhealth = 900},
["Pidgey"] = {chance = 11, corpse = 5961, health = 380, maxhealth = 380},
["Pidgeotto"] = {chance = 26, corpse = 5966, health = 1400, maxhealth = 1400},
["Pidgeot"] = {chance = 167, corpse = 6020, health = 3800, maxhealth = 3800},
["Zubat"] = {chance = 15, corpse = 5989, health = 450, maxhealth = 450},
["Golbat"] = {chance = 53, corpse = 6053, health = 1900, maxhealth = 1900},
["Bellsprout"] = {chance = 13, corpse = 2806, health = 420, maxhealth = 420},
["Weepinbell"] = {chance = 28, corpse = 2928, health = 1100, maxhealth = 1100},
["Victreebel"] = {chance = 140, corpse = 6332, health = 4000, maxhealth = 4000},
["Poliwag"] = {chance = 8, corpse = 6042, health = 400, maxhealth = 400},
["Poliwhirl"] = {chance = 29, corpse = 6054, health = 1200, maxhealth = 1200},
["Poliwrath"] = {chance = 186, corpse = 6033, health = 4400, maxhealth = 4400},
["Oddish"] = {chance = 7, corpse = 3008, health = 340, maxhealth = 340},
["Gloom"] = {chance = 25, corpse = 6017, health = 1400, maxhealth = 1400},
["Vileplume"] = {chance = 133, corpse = 6025, health = 3300, maxhealth = 3300},
["Horsea"] = {chance = 10, corpse = 2973, health = 300, maxhealth = 300},
["Seadra"] = {chance = 87, corpse = 2872, health = 2500, maxhealth = 2500},
["Grimer"] = {chance = 14, corpse = 6055, health = 600, maxhealth = 600},
["Weedle"] = {chance = 3, corpse = 5964, health = 325, maxhealth = 325},
["Kakuna"] = {chance = 18, corpse = 6000, health = 900, maxhealth = 900},
["Beedrill"] = {chance = 40, corpse = 5990, health = 1900, maxhealth = 1900},
["Muk"] = {chance = 55, corpse = 2845, health = 2400, maxhealth = 2400},
["Doduo"] = {chance = 16, corpse = 2842, health = 600, maxhealth = 600},
["Dodrio"] = {chance = 79, corpse = 6047, health = 2650, maxhealth = 2650},
["Magnemite"] = {chance = 19, corpse = 6056, health = 450, maxhealth = 450},
["Magneton"] = {chance = 70, corpse = 6076, health = 1750, maxhealth = 1750},
["Voltorb"] = {chance = 13, corpse = 6049, health = 620, maxhealth = 620},
["Electrode"] = {chance = 60, corpse = 6051, health = 2000, maxhealth = 2000},
["Geodude"] = {chance = 17, corpse = 6071, health = 700, maxhealth = 700},
["Graveler"] = {chance = 105, corpse = 6516, health = 3000, maxhealth = 3000},
["Golem"] = {chance = 205, corpse = 6043, health = 6500, maxhealth = 6500},
["Sandshrew"] = {chance = 16, corpse = 5988, health = 700, maxhealth = 700},
["Paras"] = {chance = 43, corpse = 3007, health = 250, maxhealth = 250},
["Parasect"] = {chance = 83, corpse = 6027, health = 823, maxhealth = 823},
["Scyther"] = {chance = 88, corpse = 3002, health = 823, maxhealth = 823},
["Pinsir"] = {chance = 89, corpse = 7282, health = 399, maxhealth = 399},
["Sandslash"] = {chance = 160, corpse = 6041, health = 3400, maxhealth = 3400},
["Vulpix"] = {chance = 10, corpse = 6003, health = 2500, maxhealth = 2500},
["Ninetales"] = {chance = 44, corpse = 6040, health = 250, maxhealth = 250},
["Charmander"] = {chance = 20, corpse = 5983, health = 970, maxhealth = 970},
["Charmeleon"] = {chance = 73, corpse = 5981, health = 2900, maxhealth = 2900},
["Charizard"] = {chance = 261, corpse = 6005, health = 5200, maxhealth = 5200},
}

local description = "Contains a %pokename."

function onUse(cid, item, frompos, item2, topos)
local name = getItemNameById(item2.itemid)
if item.itemid == 2147 then
catchrate = 1
oncatch = 24
onfail = 23
bolabola = 2222
elseif item.itemid == 2146 then
catchrate = 4
oncatch = 200
onfail = 199
bolabola = 2220
end
local rate = (catchrate)
local catch = oncatch
local fail = onfail
local newid = bolabola
for i,x in pairs(pokes) do
if getItemNameById(item2.itemid):find(i:lower()) then
if getItemIdByName(name) == pokes[i].corpse then
if cid ~= getItemAttribute(item2.uid, "corpseowner") and isInArray({1,8}, getPlayerGroupId(cid)) then
doPlayerSendCancel(cid, "You are not allowed to catch this pokemon.")
return true
end
doRemoveItem(item.uid, 1)
doRemoveItem(item2.uid, 1)
local pegar = math.random(0, x.chance)
if pegar <= 1*(rate) then
doSendMagicEffect(topos, catch)

local nas = {
["%%pokename"] = i
}
for i,x in pairs(nas) do
if description:find(i) then
description = description:gsub(i, x)
end
end

local function capturou(params)
if not isCreature(params.cid) then
return true
end
if not string.find(getPlayerStorageValue(cid, 54842), ""..i..",") then
doPlayerAddSoul(cid, 1)
setPlayerStorageValue(cid, 54842, getPlayerStorageValue(cid, 54842)..""..i..", ")
end
if getPlayerFreeCap(cid) <= 0.99 then
item = doCreateItemEx(newid-1)
doItemSetAttribute(item, "poke", params.poke)
doItemSetAttribute(item, "nome", params.nome)
doItemSetAttribute(item, "description", params.description)
doPlayerSendMailByName(getCreatureName(params.cid), item, 1)
doPlayerSendTextMessage(cid, 27, "Congratulations, you caught a "..i.."!")
doPlayerSendTextMessage(cid, 27, "Since you are already holding six pokemons, this pokeball has been sent to your depot.")
else
item = doCreateItemEx(params.ball)
doItemSetAttribute(item, "poke", params.poke)
doItemSetAttribute(item, "nome", params.nome)
doItemSetAttribute(item, "description", params.description)
doPlayerAddItemEx(params.cid, item, true)
doTransformItem(item, newid)
doPlayerSendTextMessage(cid, 27, "Congratulations, you caught a "..i.."!")
end
if #getCreatureSummons(cid) >= 1 then
doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 178)
else
doSendMagicEffect(getThingPos(cid), 178)
end
end

local description = "Contains a "..i.."."
local poke1 = "This is "..i.."'s pokeball. HP = ["..x.health.."/"..x.maxhealth.."]"
addEvent(capturou, 4000, {cid = cid, poke = poke1, nome = i, description = description, ball = 2219, letter = 2597})
else
function ruim(params)
if not isCreature(params.cid) then
return true
end
doPlayerSendTextMessage(params.cid, 27, "Sorry, you didn\'t catch that pokemon.")
if #getCreatureSummons(params.cid) >= 1 then
doSendMagicEffect(getThingPos(getCreatureSummons(params.cid)[1]), 166)
else
doSendMagicEffect(getThingPos(params.cid), 166)
end
end
addEvent(ruim, 4000, {cid = cid})
doSendMagicEffect(topos, fail)
end
end
end
end
return TRUE
end

 

O que ta dano erro?

 

 

["Vaporeon"] = {chance = 69, corpse = 5960, health = 4500, maxhealth = 4500}

 

/\ essa linha voce nao adiciono virgula(,)

 

sendo assim

 

["Vaporeon"] = {chance = 69, corpse = 5960, health = 4500, maxhealth = 4500},

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...