Salve galera tudo tranquilo? Então recentemente eu resolvi voltar a mexer com poketibia e comecei a "fuçar" na base do PSTORM que tem disponível tentando adaptar os scripts dela em outra base coisa que não ta dando muito certo mas fazer o que sou brasileiro e não desisto \o/
Voltando ao assunto do tópico quando tentei colocar o catch system em outra base, ele começou a dar um erro realmente "CHATOOOOOOO" eis o erro:
[30/01/2016 18:08:22] [Error - Action Interface] [30/01/2016 18:08:22] data/actions/scripts/catch.lua:onUse [30/01/2016 18:08:22] Description: [30/01/2016 18:08:22] (luaAddEvent) Callback parameter should be a function.
Tipo ele solta o efeito de captura tudo bonitinho só que na hora de mandar a msg e add o item ele da esse erro maldito.
Eis o script:
local pokes = { ["Dragon"] = {c = 5973, chance = 100}, ["Dragon Lord"] = {c = 5984, chance = 100}, ["Demon"] = {c = 5995, chance = 100}, } local time = 4 local pokeballs = { [9271] = {multiplier=1, failEffect=23, successEffect=24, shootEffect=17}, -- STARTER'S PB [2149] = {multiplier=1, failEffect=23, successEffect=24, shootEffect=17}, -- PB [2147] = {multiplier=2, failEffect=197, successEffect=198, shootEffect=19}, -- GB [2150] = {multiplier=3, failEffect=201, successEffect=202, shootEffect=20}, -- SB [2146] = {multiplier=4, failEffect=199, successEffect=200, shootEffect=27}, -- UB [2151] = {multiplier=1, failEffect=203, successEffect=204, shootEffect=36}, -- Saffari Ball } catchRate = 1 local function onCapturePokemon(cid, name, params) if isCreature(cid) then doPlayerAddSoul(cid, 1) doPlayerSendTextMessage(cid, 20, "You catch a Pokemon! ("..name..").") if #getPlayerPokeballs(cid) >= 6 then local pokeball = doCreatePokeball(name, params.pokeball-1) doPlayerSendMailByName(getCreatureName(cid), pokeball) doPlayerSendTextMessage(cid, 20, "Since you are already holding six pokemons, this pokeball has been sent to your depot.") else local pokeball = doCreatePokeball(name, params.pokeball) doPlayerAddItemEx(cid, pokeball) end end local function onFailCapturePokemon(cid) doSendMagicEffect(getCreaturePosition(creature), 166) doPlayerSendTextMessage(cid, 27, "Sorry, you didn\'t catch that pokemon.") end end function onUse(cid, item, frompos, item2, topos) if getItemAttribute(item2.uid, "corpseowner") ~= cid then doPlayerSendCancel(cid, "You are not the owner of this corpse.") return true end for i, x in pairs(pokes) do if item2.itemid == x.c then local chances = (x.chance) * pokeballs[item.itemid].multiplier * catchRate if chances == 0 then doPlayerSendCancel(cid, "This pokemon is uncatchable.") return TRUE end if math.random(1, 940) <= chances then doSendDistanceShoot(frompos, topos, pokeballs[item.itemid].shootEffect) doSendMagicEffect(topos, pokeballs[item.itemid].successEffect) addEvent(onCapturePokemon, time*1000, cid, i, {pokeball = getPokeballIn(item.itemid) }) else doSendDistanceShoot(frompos, topos, pokeballs[item.itemid].shootEffect) doSendMagicEffect(topos, pokeballs[item.itemid].failEffect) addEvent(onFailCapturePokemon, time*1000, cid) end doRemoveItem(item.uid, 1) doRemoveItem(item2.uid, 1) return TRUE end end doPlayerSendCancel(cid, "Sorry, not possible.") return TRUE end
Solicito a ajuda de vocês pelo amr de deus T-T
#up
#up
#up
Pelo amr de deus me ajudem!