Postado Maio 31, 2018 6 anos Fala gente boa noite, bom eu e um amigo meu estavamos a criar uma dex para o meu servidor de tibia, isso msmo um servidor de tibia com dex, porem nos deparamos com seguinte erro? [31/05/2018 16:00:26] [Error - Action Interface] [31/05/2018 16:00:26] data/actions/scripts/monsterdex.lua:onUse [31/05/2018 16:00:26] Description: [31/05/2018 16:00:26] data/actions/scripts/monsterdex.lua:14: attempt to concatenate a boolean value [31/05/2018 16:00:26] stack traceback: [31/05/2018 16:00:26] data/actions/scripts/monsterdex.lua:14: in function <data/actions/scripts/monsterdex.lua:4> e entao demos uma parada ao codigo, porem eu preciso dele, vou por aqui o codigo. local OPCODE_MONSTERDEX = opcodes.OPCODE_MONSTERDEX local OPCODE_CREATE_MONSTERS = opcodes.OPCODE_CREATE_MONSTERS function onUse(cid, item, fromPosition, itemEx, toPosition) if not isCreature(itemEx.uid) then return true end if getPlayerStorageValue(cid, storages.monsterdexDelay) == 1 then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Não use a monsterdex tão rápido.") end local name = isPlayer(itemEx.uid) and getCreatureName(itemEx.uid) or getMonsterName(itemEx.uid) local str = {} for monsterId = 1, 42 do table.insert(str, ((monsterId > 9 and monsterId < 100) and "#0" or (monsterId < 10) and "#00" or "#")..monsterId) table.insert(str, "|".. getMonsterDescription(name)) table.insert(str, "|".. getMonsterAttack(name)) table.insert(str, "|".. getMonsterDefense(name)) table.insert(str, "|".. getMonsterVitality(name)) table.insert(str, "|".. getMonsterLevel(name)) end if isMonster(itemEx.uid) or (isPlayer(itemEx.uid) and itemEx.uid == cid) then doSendPlayerExtendedOpcode(cid, OPCODE_CREATE_MONSTERS, table.concat(str)) setPlayerStorageValue(cid, storages.monsterdexDelay, 1) addEvent(setPlayerStorageValue, 3000, cid, storages.monsterdexDelay, -1) end if isMonster(itemEx.uid) then if getPlayerStorageValue(cid, getMonsterUniqueStorToDex(name)) == -1 then local exp = (getMonsterLevel(name) * 10) / 2 setPlayerStorageValue(cid, getMonsterUniqueStorToDex(name), 1) setPlayerStorageValue(cid, storages.monsterdexSys, getPlayerStorageValue(cid, storages.monsterdexSys) + 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você desbloqueou o monstro "..doCorrectString(name).." e ganhou "..exp.." de experiencia.") doPlayerAddExp_2(cid, exp) doSendMagicEffect(getThingPos(cid), 91) end doSendPlayerExtendedOpcode(cid, OPCODE_MONSTERDEX, pokeId.."|"..doCorrectString(name).."|"..getMonsterLevel(name).."|"..(getPlayerStorageValue(cid, getMonsterUniqueStorToCatch(name)) == -1 and "false" or "true").."|"..getMonsterDescription(name).."|"..getMonsterAttack(name).."|"..getMonsterDefense(name).."|"..getMonsterVitality(name)) elseif isPlayer(itemEx.uid) and itemEx.uid == cid then doSendPlayerExtendedOpcode(cid, OPCODE_MONSTERDEX, name) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você tem a monsterdex de "..(getPlayerStorageValue(cid, storages.monsterdexSys) + 1).." monster"..(getPlayerStorageValue(cid, storages.monsterdexSys) + 1 == 1 and "" or "s").." de kanto.") end return true end e tbm o arquivo lib. monstersInfo = { ["demon"] = {attack = 49, defense = 49, vitality = 45, level = 20}, } monstersDescription = { ["demon"] = {"No description.", 1}, } storages = { monsterdexSys = 8000, monsterdexDelay = 8100, } opcodes = { OPCODE_MONSTERDEX = 100, OPCODE_CREATE_MONSTERS = 101, } function doCorrectMonsterName(monster) return doCorrectString(monster) end function doCorrectString(str) local name = string.explode(tostring(str), " ") local final = {} for _, s in ipairs(name) do table.insert(final, s:sub(1, 1):upper()..s:sub(2, #s):lower()) end return table.concat(final, (name[2] and " " or "")) end function doPlayerAddExp_2(cid, exp) if not isCreature(cid) then return true end doPlayerAddExp(cid, exp) doSendAnimatedText(getThingPos(cid), exp, 215) end function getMonsterName(cid) if not isCreature(cid) then return "" end return getPlayerStorageValue(cid, 510) or "" end function getMonsterLevel(name) if not monstersInfo[string.lower(name)] then return false end if monstersInfo[string.lower(name)].level <= 1 then return 5 end return monstersInfo[string.lower(name)].level end function getMonsterDescription(name) if not monstersDescription[string.lower(name)] then return false end return monstersDescription[string.lower(name)][1] end function getMonsterAttack(name) if not monstersInfo[string.lower(name)] then return false end return monstersInfo[string.lower(name)].attack end function getMonsterDefense(name) if not monstersInfo[string.lower(name)] then return false end return monstersInfo[string.lower(name)].defense end function getMonsterVitality(name) if not monstersInfo[string.lower(name)] then return false end return monstersInfo[string.lower(name)].vitality end function getPokemonSpAttack(name) if not pokesInfo[string.lower(name)] then return false end return pokesInfo[string.lower(name)].spAttack end function getMonsterUniqueStorToCatch(monster) return true end function getMonsterUniqueStorToDex(monster) return true end quando ligo o servidor nao aparece nenhum erro nem nada, mas ao usar o item causa aquele 1 erro, e fala que nao posso usar o item. Alguem pra me ajudar? desde ja agradeco muito Valendo REP++
Postado Maio 31, 2018 6 anos Troca o arquivo da action por esse, acho que tu concatenou errado kk https://hastebin.com/ocinivawuy.sql
Postado Maio 31, 2018 6 anos Autor [31/05/2018 19:57:01] [Error - Action Interface] [31/05/2018 19:57:01] data/actions/scripts/monsterdex.lua:onUse [31/05/2018 19:57:01] Description: [31/05/2018 19:57:01] data/actions/scripts/monsterdex.lua:14: attempt to concatenate a boolean value [31/05/2018 19:57:01] stack traceback: [31/05/2018 19:57:01] data/actions/scripts/monsterdex.lua:14: in function <data/actions/scripts/monsterdex.lua:4> estou tentando arrumar, ate o momento o erro agr é esse. Bom, quando inicio o servidor, e tals e nada acontece, apenas quando tento usar o item, e clico no monstro, ele fala que nao posso usar o item, you cannot use this object, ai aparece o erro
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.