Ir para conteúdo
  • 0

Erro no look


Nooob II

Pergunta

Estou com esse erro no distro toda vez que dou look em algo

 

look.lua

 

 

local addons = {        [751] = {pokemon= "Electabuzz" , looktype = 1911},        [748] = {pokemon= "Charizard" , looktype = 1910},        [755] = {pokemon= "Blastoise" , looktype = 1909},        [754] = {pokemon= "Shiny Nidoking" , looktype = 1914},        [753] = {pokemon= "Arcanine" , looktype = 1908},        [752] = {pokemon= "Shiny Golem" , looktype = 1913},    }     local function getOldAddon (looktype)    for index, value in pairs (addons) do        if value.looktype == looktype then            return index        end    endendlocal NPCBattle = {["Brock"] = {artig = "He is", cidbat = "Pewter"},["Misty"] = {artig = "She is", cidbat = "Cerulean"}, ["Blaine"] = {artig = "He is", cidbat = "Cinnabar"},["Sabrina"] = {artig = "She is", cidbat = "Saffron"},         --alterado v1.9 \/ peguem tudo!["Kira"] = {artig = "She is", cidbat = "Viridian"},["Koga"] = {artig = "He is", cidbat = "Fushcia"},["Erika"] = {artig = "She is", cidbat = "Celadon"},["Surge"] = {artig = "He is", cidbat = "Vermilion"},}  local gastostones = {[0] = 0,[1] = 1,[2] = 2,[3] = 3,[4] = 4,[5] = 6,[6] = 8,[7] = 10,[8] = 12,[9] = 15,[10] = 18,[11] = 21,[12] = 24,[13] = 28,[14] = 32,[15] = 36,[16] = 40,[17] = 45,[18] = 50,[19] = 55,[20] = 60,[21] = 66,[22] = 72,[23] = 78,[24] = 84,[25] = 91,[26] = 98,[27] = 105,[28] = 112,[29] = 120,[30] = 128,[31] = 136,[32] = 144,[33] = 153,[34] = 162,[35] = 171,[36] = 180,[37] = 190,[38] = 200,[39] = 210,[40] = 220,[41] = 231,[42] = 242,[43] = 253,[44] = 264,[45] = 276,[46] = 288,[47] = 300,[48] = 312,[49] = 325,[50] = 338,} local xhelds = {[1] = {name = "X-Defense (Tier: 1)"},[2] = {name = "X-Defense (Tier: 2)"},[3] = {name = "X-Defense (Tier: 3)"},[4] = {name = "X-Defense (Tier: 4)"},[5] = {name = "X-Defense (Tier: 5)"},[6] = {name = "X-Defense (Tier: 6)"},[7] = {name = "X-Defense (Tier: 7)"},[8] = {name = "X-Attack (Tier : 1)"},[9] = {name = "X-Attack (Tier : 2)"},[10] = {name = "X-Attack (Tier: 3)"},[11] = {name = "X-Attack (Tier: 4)"},[12] = {name = "X-Attack (Tier: 5)"},[13] = {name = "X-Attack (Tier: 6)"},[14] = {name = "X-Attack (Tier: 7)"},[15] = {name = "X-Return (Tier: 1)"},[16] = {name = "X-Return (Tier: 2)"},[17] = {name = "X-Return (Tier: 3)"},[18] = {name = "X-Return (Tier: 4)"},[19] = {name = "X-Return (Tier: 5)"},[20] = {name = "X-Return (Tier: 6)"},[21] = {name = "X-Return (Tier: 7)"},[22] = {name = "X-Hellfire (Tier: 1)"},[23] = {name = "X-Hellfire (Tier: 2)"},[24] = {name = "X-Hellfire (Tier: 3)"},[25] = {name = "X-Hellfire (Tier: 4)"},[26] = {name = "X-Hellfire (Tier: 5)"},[27] = {name = "X-Hellfire (Tier: 6)"},[28] = {name = "X-Hellfire (Tier: 7)"},[29] = {name = "X-Poison (Tier: 1)"},[30] = {name = "X-Poison (Tier: 2)"},[31] = {name = "X-Poison (Tier: 3)"},[32] = {name = "X-Poison (Tier: 4)"},[33] = {name = "X-Poison (Tier: 5)"},[34] = {name = "X-Poison (Tier: 6)"},[35] = {name = "X-Poison (Tier: 7)"},[36] = {name = "X-Boost (Tier: 1)"},[37] = {name = "X-Boost (Tier: 2)"},[38] = {name = "X-Boost (Tier: 3)"},[39] = {name = "X-Boost (Tier: 4)"},[40] = {name = "X-Boost (Tier: 5)"},[41] = {name = "X-Boost (Tier: 6)"},[42] = {name = "X-Boost (Tier: 7)"},[43] = {name = "X-Agility (Tier: 1)"},[44] = {name = "X-Agility (Tier: 2)"},[45] = {name = "X-Agility (Tier: 3)"},[46] = {name = "X-Agility (Tier: 4)"},[47] = {name = "X-Agility (Tier: 5)"},[48] = {name = "X-Agility (Tier: 6)"},[49] = {name = "X-Agility (Tier: 7)"},[50] = {name = "X-Strafe (Tier: 1)"},[51] = {name = "X-Strafe (Tier: 2)"},[52] = {name = "X-Strafe (Tier: 3)"},[53] = {name = "X-Strafe (Tier: 4)"},[54] = {name = "X-Strafe (Tier: 5)"},[55] = {name = "X-Strafe (Tier: 6)"},[56] = {name = "X-Strafe (Tier: 7)"},[57] = {name = "X-Rage (Tier: 1)"},[58] = {name = "X-Rage (Tier: 2)"},[59] = {name = "X-Rage (Tier: 3)"},[60] = {name = "X-Rage (Tier: 4)"},[61] = {name = "X-Rage (Tier: 5)"},[62] = {name = "X-Rage (Tier: 6)"},[63] = {name = "X-Rage (Tier: 7)"},[64] = {name = "X-Harden (Tier: 1)"},[65] = {name = "X-Harden (Tier: 2)"},[66] = {name = "X-Harden (Tier: 3)"},[67] = {name = "X-Harden (Tier: 4)"},[68] = {name = "X-Harden (Tier: 5)"},[69] = {name = "X-Harden (Tier: 6)"},[70] = {name = "X-Harden (Tier: 7)"},[71] = {name = "X-Experience (Tier: 1)"},[72] = {name = "X-Experience (Tier: 2)"},[73] = {name = "X-Experience (Tier: 3)"},[74] = {name = "X-Experience (Tier: 4)"},[75] = {name = "X-Experience (Tier: 5)"},[76] = {name = "X-Experience (Tier: 6)"},[77] = {name = "X-Experience (Tier: 7)"},[78] = {name = "X-Elemental (Tier: 1)"},[79] = {name = "X-Elemental (Tier: 2)"},[80] = {name = "X-Elemental (Tier: 3)"},[81] = {name = "X-Elemental (Tier: 4)"},[82] = {name = "X-Elemental (Tier: 5)"},[83] = {name = "X-Elemental (Tier: 6)"},[84] = {name = "X-Elemental (Tier: 7)"},[85] = {name = "X-Critical (Tier: 1)"},[86] = {name = "X-Critical (Tier: 2)"},[87] = {name = "X-Critical (Tier: 3)"},[88] = {name = "X-Critical (Tier: 4)"},[89] = {name = "X-Critical (Tier: 5)"},[90] = {name = "X-Critical (Tier: 6)"},[91] = {name = "X-Critical (Tier: 7)"},[92] = {name = "X-Vitality (Tier: 1)"},[93] = {name = "X-Vitality (Tier: 2)"},[94] = {name = "X-Vitality (Tier: 3)"},[95] = {name = "X-Vitality (Tier: 4)"},[96] = {name = "X-Vitality (Tier: 5)"},[97] = {name = "X-Vitality (Tier: 6)"},[98] = {name = "X-Vitality (Tier: 7)"},[99] = {name = "X-Haste (Tier: 1)"},[100] = {name = "X-Haste (Tier: 2)"},[101] = {name = "X-Haste (Tier: 3)"},[102] = {name = "X-Haste (Tier: 4)"},[103] = {name = "X-Haste (Tier: 5)"},[104] = {name = "X-Haste (Tier: 6)"},[105] = {name = "X-Haste (Tier: 7)"},[106] = {name = "X-Accuracy (Tier: 1)"},[107] = {name = "X-Accuracy (Tier: 2)"},[108] = {name = "X-Accuracy (Tier: 3)"},[109] = {name = "X-Accuracy (Tier: 4)"},[110] = {name = "X-Accuracy (Tier: 5)"},[111] = {name = "X-Accuracy (Tier: 6)"},[112] = {name = "X-Accuracy (Tier: 7)"},[113] = {name = "X-Cooldown (Tier: 3)"},[114] = {name = "X-Cooldown (Tier: 5)"},[115] = {name = "X-Cooldown (Tier: 7)"},[116] = {name = "X-Blink (Tier: 5)"},} local yhelds = {[1] = {name = "Y-Regeneration (Tier: 1)"},[2] = {name = "Y-Regeneration (Tier: 2)"},[3] = {name = "Y-Regeneration (Tier: 3)"},[4] = {name = "Y-Regeneration (Tier: 4)"},[5] = {name = "Y-Regeneration (Tier: 5)"},[6] = {name = "Y-Regeneration (Tier: 6)"},[7] = {name = "Y-Regeneration (Tier: 7)"},[8] = {name = "Y-Cure (Tier: 1)"},[9] = {name = "Y-Cure (Tier: 2)"},[10] = {name = "Y-Cure (Tier: 3)"},[11] = {name = "Y-Cure (Tier: 4)"},[12] = {name = "Y-Cure (Tier: 5)"},[13] = {name = "Y-Cure (Tier: 6)"},[14] = {name = "Y-Cure (Tier: 7)"},[15] = {name = "Y-Wing (Tier: 1)"},[16] = {name = "Y-Wing (Tier: 2)"},[17] = {name = "Y-Wing (Tier: 3)"},[18] = {name = "Y-Wing (Tier: 4)"},[19] = {name = "Y-Wing (Tier: 5)"},[20] = {name = "Y-Wing (Tier: 6)"},[21] = {name = "Y-Wing (Tier: 7)"},[22] = {name = "Y-Ghost (Tier: 4)"},} function onLook(cid, thing, position, lookDistance)                                                          local str = {}                                              if not isCreature(thing.uid) then   local iname = getItemInfo(thing.itemid)   if isPokeball(thing.itemid) and getItemAttribute(thing.uid, "poke") then       end      unLock(thing.uid)      local lock = getItemAttribute(thing.uid, "lock")              local pokename = getItemAttribute(thing.uid, "poke") local heldx = getItemAttribute(thing.uid, "heldx")local heldy = getItemAttribute(thing.uid, "heldy")local boost = getItemAttribute(thing.uid, "boost") or 0      table.insert(str, "You see "..iname.article.." "..iname.name..".")         if getItemAttribute(thing.uid, "unique") then                        table.insert(str, " It's an unique item.")         end if pokesPrice[pokename] then local precocerto = (pokesPrice[pokename]) + ((gastostones[boost] * 5) * (100000 * 0.01))      table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename..". ".."Price: $"..precocerto..".\n")   elsetable.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename..". ".."Price: Unsellable.\n") endif getItemAttribute(thing.uid, "ehditto") == 1 thentable.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename.." (Ditto).\n")elseif getItemAttribute(thing.uid, "ehshinyditto") == 1 thentable.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename.." (Shiny Ditto).\n")elsetable.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename..".\n")end      if lock and lock > 0 then         table.insert(str, "It will unlock in ".. os.date("%d/%m/%y %X", lock)..".\n")        end      if boost > 0 then         table.insert(str, "Boost level: +"..boost..".\n")      end      if getItemAttribute(thing.uid, "nick") then         table.insert(str, "It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n")      end if heldx and heldy thentable.insert(str, "Holding: "..(xhelds[heldx].name).." and "..(yhelds[heldy].name)..". ")elseif heldx thentable.insert(str, "Holding: "..(xhelds[heldx].name)..". ")elseif heldy thentable.insert(str, "Holding: "..(yhelds[heldy].name)..". ")end        if getItemAttribute(thing.uid, "gender") == SEX_MALE then         table.insert(str, "It is male.")      elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then         table.insert(str, "It is female.")      endif getItemAttribute(thing.uid, "addon") then        if flysAddon[getItemAttribute (thing.uid, "addon")] or ridesAddon[getItemAttribute (thing.uid, "addon")] or surfsAddon[getItemAttribute (thing.uid, "addon")] then            if getItemAttribute(thing.uid, "addon") > 1 then                table.insert(str, " Has the addon "..getItemNameById (getAddonId (getItemAttribute (thing.uid, "addon")))..".")            end        end    end      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))      return false         elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then            table.insert(str, "You see a "..string.lower(iname.name)..". ")           if isContainer(thing.uid) then         table.insert(str, "(Vol: "..getContainerCap(thing.uid)..")")      end      table.insert(str, "\n")      if getItemAttribute(thing.uid, "gender") == SEX_MALE then         table.insert(str, "It is male.")      elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then         table.insert(str, "It is female.")      endif getItemAttribute(thing.uid, "addon") then        if flysAddon[getItemAttribute (thing.uid, "addon")] or ridesAddon[getItemAttribute (thing.uid, "addon")] or surfsAddon[getItemAttribute (thing.uid, "addon")] then            if getItemAttribute(thing.uid, "addon") > 1 then                table.insert(str, " Has the addon "..getItemNameById (getAddonId (getItemAttribute (thing.uid, "addon")))..".")            end        end    end      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))      return false    elseif isContainer(thing.uid) then     --containers       if iname.name == "dead human" and getItemAttribute(thing.uid, "pName") then         table.insert(str, "You see a dead human (Vol:"..getContainerCap(thing.uid).."). ")         table.insert(str, "You recognize ".. getItemAttribute(thing.uid, "pName")..". ".. getItemAttribute(thing.uid, "article").." was killed by a ")         table.insert(str, getItemAttribute(thing.uid, "attacker")..".")      else            table.insert(str, "You see "..iname.article.." "..iname.name..". (Vol:"..getContainerCap(thing.uid)..").")      end      if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then         table.insert(str, "\nItemID: ["..thing.itemid.."]")              local pos = getThingPos(thing.uid)         table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]")        end      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))      return false         elseif getItemAttribute(thing.uid, "unique") then          local p = getThingPos(thing.uid)         table.insert(str, "You see ")      if thing.type > 1 then         table.insert(str, thing.type.." "..iname.plural..".")      else         table.insert(str, iname.article.." "..iname.name..".")      end      table.insert(str, " It's an unique item.\n"..iname.description)            if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then         table.insert(str, "\nItemID: ["..thing.itemid.."]")         table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]")      end         sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str))      return false   else      return true   end local npcname = getCreatureName(thing.uid)if ehNPC(thing.uid) and NPCBattle[npcname] then    --npcs duel   table.insert(str, "You see "..npcname..". "..NPCBattle[npcname].artig.." leader of the gym from "..NPCBattle[npcname].cidbat..".")   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))   return falseendif getPlayerStorageValue(thing.uid, 697548) ~= -1 then       table.insert(str, getPlayerStorageValue(thing.uid, 697548))                                      local pos = getThingPos(thing.uid)   if youAre[getPlayerGroupId(cid)] then      table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]")   end   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))     return falseend if not isPlayer(thing.uid) and not isMonster(thing.uid) then    --outros npcs   table.insert(str, "You see "..getCreatureName(thing.uid)..".")   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))   return falseend if isPlayer(thing.uid) then     --player   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getPlayerDesc(cid, thing.uid, false))  return falseend if getCreatureName(thing.uid) == "Evolution" then return false end if not isSummon(thing.uid) then   --monstros      table.insert(str, "You see a "..string.lower(getCreatureName(thing.uid))..".\n")   table.insert(str, "Hit Points: "..getCreatureHealth(thing.uid).." / "..getCreatureMaxHealth(thing.uid)..".\n")   if getPokemonGender(thing.uid) == SEX_MALE then      table.insert(str, "It is male.")   elseif getPokemonGender(thing.uid) == SEX_FEMALE then      table.insert(str, "It is female.")   end   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))   return false elseif isSummon(thing.uid) and not isPlayer(thing.uid) then  --summons    local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0   if getCreatureMaster(thing.uid) == cid then      local myball = getPlayerSlotItem(cid, 8).uid      table.insert(str, "You see your "..string.lower(getCreatureName(thing.uid))..".")      if boostlevel > 0 then         table.insert(str, "\nBoost level: +"..boostlevel..".")      end      table.insert(str, "\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")      table.insert(str, "\n"..getPokemonHappinessDescription(thing.uid))      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))   else      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(getCreatureName(thing.uid))..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".")   end   return false   endreturn trueend

 

 

 

[10/01/2017 20:09:16] [Error - CreatureScript Interface] [10/01/2017 20:09:16] data/creaturescripts/scripts/look.lua:onLook[10/01/2017 20:09:16] Description: [10/01/2017 20:09:16] data/creaturescripts/scripts/look.lua:282: attempt to index global 'ridesAddon' (a nil value)[10/01/2017 20:09:16] stack traceback:[10/01/2017 20:09:16]     data/creaturescripts/scripts/look.lua:282: in function <data/creaturescripts/scripts/look.lua:227>[10/01/2017 20:09:18] [Error - CreatureScript Interface] [10/01/2017 20:09:18] data/creaturescripts/scripts/look.lua:onLook[10/01/2017 20:09:18] Description: [10/01/2017 20:09:18] data/lib/050-function.lua:107: attempt to index local 'str' (a nil value)[10/01/2017 20:09:18] stack traceback:[10/01/2017 20:09:18]     data/lib/050-function.lua:107: in function 'getArticle'[10/01/2017 20:09:18]     data/creaturescripts/scripts/look.lua:249: in function <data/creaturescripts/scripts/look.lua:227>[10/01/2017 20:09:41] ".[10/01/2017 20:09:51] [Error - CreatureScript Interface] [10/01/2017 20:09:51] data/creaturescripts/scripts/look.lua:onLook[10/01/2017 20:09:51] Description: [10/01/2017 20:09:51] data/creaturescripts/scripts/look.lua:291: attempt to index global 'iname' (a nil value)[10/01/2017 20:09:51] stack traceback:[10/01/2017 20:09:51]     data/creaturescripts/scripts/look.lua:291: in function <data/creaturescripts/scripts/look.lua:227>
Editado por Nooob II
Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

×
×
  • Criar Novo...