• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Can't summon monster/pokemon in PZ area

drag00n

New Member
Joined
Apr 16, 2018
Messages
3
Reaction score
0
Hi i have a pokemon otserv version 8.54 and i can't summon the pokemon/monster in pz area of course..
appears this error:
Code:
[21/08/2019 19:55:45] [Error - Action Interface]
[21/08/2019 19:55:45] data/actions/scripts/masterball.lua:onUse
[21/08/2019 19:55:45] Description:
[21/08/2019 19:55:45] (luaDoConvinceCreature) Creature not found

[21/08/2019 19:55:45] [Error - Action Interface]
[21/08/2019 19:55:45] data/actions/scripts/masterball.lua:onUse
[21/08/2019 19:55:46] Description:
[21/08/2019 19:55:46] (luaRegisterCreatureEvent) Creature not found

[21/08/2019 19:55:46] [Error - Action Interface]
[21/08/2019 19:55:46] data/actions/scripts/masterball.lua:onUse
[21/08/2019 19:55:46] Description:
[21/08/2019 19:55:46] (luaGetThingPosition) Thing not found

[21/08/2019 19:55:46] [Error - Action Interface]
[21/08/2019 19:55:46] data/actions/scripts/masterball.lua:onUse
[21/08/2019 19:55:46] Description:
[21/08/2019 19:55:46] (luaDoCreatureAddHealth) Creature not found

My masterball.lua is
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
function getPokemonMaxLife(name)
        local file = io.open('data/monster/monsters.xml','r')
        local arquivo = file:read(-1):lower():match('<monster name="'..name:lower()..'" file="(.-)"/>')
        file:close()
        local data = io.open('data/monster/'..(arquivo or ''),'r')
        if not data then
            return 100
        end
        local maximo = data:read(-1):match('max%s*=%s*"(%d+)"')
        data:close()
        return maximo
end
----- Config -----
local MaximoSummon = 1
local nome = getItemName(item.uid)
local poke_name = nome:match('(.-) Masterball')
local summons = getCreatureSummons(cid)
local action_id = getItemAttribute(item.uid, "aid")
----- Config -----
    if getPlayerStorageValue(cid, 25000) == 5 then     
    return doPlayerSendCancel(cid, "You are riding.")
    end
    if getPlayerStorageValue(cid, 23000) == 5 then
    return doPlayerSendCancel(cid, "You are flying.")
    end
    if getItemAttribute(item.uid, "aid") == -1 then
    return doPlayerSendCancel(cid, "Your Pokemon Is Dead.")
    end 
local summons = getCreatureSummons(cid)
if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then
doPlayerSendCancel(cid, "Sorry, you must put your pokeball in the pokeball place.")
return TRUE
end
if(table.maxn(summons) < MaximoSummon) then -- no summons
creature = doSummonCreature(poke_name, getCreaturePosition(cid))
doConvinceCreature(cid, creature)
registerCreatureEvent(creature, "Masterball")
registerCreatureEvent(cid, "PlayerPokeDeath")
registerCreatureEvent(cid, "LogoutPoke")
doPlayerSay(cid, "Go,"..poke_name.."!!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(creature), 196)
doTransformItem(getPlayerSlotItem(cid,8).uid, 2523, 1)
doItemSetAttribute(getPlayerSlotItem(cid,8).uid,"name", poke_name .." Masterball")
        if action_id ~= 0 then
doCreatureAddHealth(creature, -(tonumber(getPokemonMaxLife(poke_name) - action_id)))
        else
        doCreatureAddHealth(creature, getPokemonMaxLife(poke_name))
        end
else
for _, pid in ipairs(summons) do
if (table.maxn(summons) >= 1) then
doItemSetAttribute(item.uid, "aid", getCreatureHealth(summons[1]))
doSendMagicEffect(getCreaturePosition(getCreatureSummons(cid)[1]), 196)
doPlayerSay(cid,"Back, "..poke_name.."", TALKTYPE_ORANGE_1)
doRemoveCreature(pid)
doTransformItem(getPlayerSlotItem(cid,8).uid, 2195, 1)
doItemSetAttribute(getPlayerSlotItem(cid,8).uid,"name", poke_name .." Masterball")
end
end
end
return true
end

Can someone help me with this please? cheers and sorry about my english
 
Last edited by a moderator:
Hi i have a pokemon otserv version 8.54 and i can't summon the pokemon/monster in pz area of course..
appears this error:
Note: Your script is very badly done.
But try it
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
function getPokemonMaxLife(name)
        local file = io.open('data/monster/monsters.xml','r')
        local arquivo = file:read(-1):lower():match('<monster name="'..name:lower()..'" file="(.-)"/>')
        file:close()
        local data = io.open('data/monster/'..(arquivo or ''),'r')
        if not data then
            return 100
        end
        local maximo = data:read(-1):match('max%s*=%s*"(%d+)"')
        data:close()
        return maximo
end
----- Config -----
local MaximoSummon = 1
local nome = getItemName(item.uid)
local poke_name = nome:match('(.-) Masterball')
local summons = getCreatureSummons(cid)
local action_id = getItemAttribute(item.uid, "aid")
----- Config -----
    if getPlayerStorageValue(cid, 25000) == 5 then   
    return doPlayerSendCancel(cid, "You are riding.")
    end
    if getPlayerStorageValue(cid, 23000) == 5 then
    return doPlayerSendCancel(cid, "You are flying.")
    end
    if getItemAttribute(item.uid, "aid") == -1 then
    return doPlayerSendCancel(cid, "Your Pokemon Is Dead.")
    end
local summons = getCreatureSummons(cid)
if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then
doPlayerSendCancel(cid, "Sorry, you must put your pokeball in the pokeball place.")
return TRUE
end
if(table.maxn(summons) < MaximoSummon) then -- no summons
local creature = doSummonCreature(poke_name, getCreaturePosition(cid))
if creature then
doConvinceCreature(cid, creature)
registerCreatureEvent(creature, "Masterball")
registerCreatureEvent(cid, "PlayerPokeDeath")
registerCreatureEvent(cid, "LogoutPoke")
doPlayerSay(cid, "Go,"..poke_name.."!!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(creature), 196)
doTransformItem(getPlayerSlotItem(cid,8).uid, 2523, 1)
doItemSetAttribute(getPlayerSlotItem(cid,8).uid,"name", poke_name .." Masterball")
        if action_id ~= 0 then
doCreatureAddHealth(creature, -(tonumber(getPokemonMaxLife(poke_name) - action_id)))
        else
        doCreatureAddHealth(creature, getPokemonMaxLife(poke_name))
        end
end
else
for _, pid in ipairs(summons) do
if (table.maxn(summons) >= 1) then
doItemSetAttribute(item.uid, "aid", getCreatureHealth(summons[1]))
doSendMagicEffect(getCreaturePosition(getCreatureSummons(cid)[1]), 196)
doPlayerSay(cid,"Back, "..poke_name.."", TALKTYPE_ORANGE_1)
doRemoveCreature(pid)
doTransformItem(getPlayerSlotItem(cid,8).uid, 2195, 1)
doItemSetAttribute(getPlayerSlotItem(cid,8).uid,"name", poke_name .." Masterball")
end
end
end
return true
end
 
Last edited:
Back
Top