Ir para conteúdo

Featured Replies

Postado

Diga em poucas palavras a base utilizada (Nome do servidor ou nome do website).

TFS 0.4

Base: 

 

Qual erro está surgindo/O que você procura?

Quando tento usar o item pra dar upgrade nao acontece nada e recebo esse erro.
 

[20:17:45.489] [Error - Action Interface]
[20:17:45.491] data/actions/scripts/refine.lua:onUse
[20:17:45.492] Description:
[20:17:45.493] data/lib/perfectrefine.lua:111: attempt to index field '?' (a nil value)
[20:17:45.494] stack traceback:
[20:17:45.495]  data/lib/perfectrefine.lua:111: in function 'chance'
[20:17:45.497]  data/lib/perfectrefine.lua:223: in function 'refine'
[20:17:45.498]  data/actions/scripts/refine.lua:19: in function <data/actions/scripts/refine.lua:1>

 

Você tem o código disponível? Se tiver publique-o aqui:

Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.

image.thumb.png.7f18c7a4a7473e66bdc288c63970edd1.png

 

Postado
  Em 22/10/2018 em 23:23, Babiloko disse:

Diga em poucas palavras a base utilizada (Nome do servidor ou nome do website).

TFS 0.4

Base: 

 

Qual erro está surgindo/O que você procura?

Quando tento usar o item pra dar upgrade nao acontece nada e recebo esse erro.
 


[20:17:45.489] [Error - Action Interface]
[20:17:45.491] data/actions/scripts/refine.lua:onUse
[20:17:45.492] Description:
[20:17:45.493] data/lib/perfectrefine.lua:111: attempt to index field '?' (a nil value)
[20:17:45.494] stack traceback:
[20:17:45.495]  data/lib/perfectrefine.lua:111: in function 'chance'
[20:17:45.497]  data/lib/perfectrefine.lua:223: in function 'refine'
[20:17:45.498]  data/actions/scripts/refine.lua:19: in function <data/actions/scripts/refine.lua:1>

 

Você tem o código disponível? Se tiver publique-o aqui:

Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.

image.thumb.png.7f18c7a4a7473e66bdc288c63970edd1.png

 

 

Procura no script "?" na hora de copiar aqui do Tk esta dando um bug que aparece "?" no meio do script.

  • 1 month later...
Postado
  Em 06/12/2018 em 20:01, Zzyzx disse:

Não é isso, estou com o mesmo erro =x

 

local conf = {
   ["level"] = {
   -- [item_level] = {successPercent= CHANCE TO UPGRADE ITEM, downgradeLevel = ITEM GETS THIS LEVEL IF UPGRADE FAILS}
     [1] = {successPercent = 85, downgradeLevel = 0},
     [2] = {successPercent = 80, downgradeLevel = 1},
     [3] = {successPercent = 75, downgradeLevel = 2},
     [4] = {successPercent = 70, downgradeLevel = 3},
     [5] = {successPercent = 65, downgradeLevel = 4},
     [6] = {successPercent = 60, downgradeLevel = 5},
     [7] = {successPercent = 55, downgradeLevel = 6},
     [8] = {successPercent = 50, downgradeLevel = 7},
     [9] = {successPercent = 45, downgradeLevel = 0}
   },

   ["upgrade"] = { -- how many percent attributes are rised?
     attack = 1, -- attack %
     defense = 1, -- defense %
     extraDefense = 2, -- extra defense %
     armor = 1, -- armor %
     hitChance = 1, -- hit chance %
   }
}

-- // do not touch // --
-- Upgrading system by Azi [Ersiu] --
-- Edited for TFS 1.1 by Zbizu --

local upgrading = {
  upValue = function (value, level, percent)
  if value < 0 then return 0 end
     if level == 0 then return value end
     local nVal = value
     for i = 1, level do
       nVal = nVal + (math.ceil((nVal/100*percent)))
     end
  return nVal > 0 and nVal or value
  end,

  getLevel = function (item)
  local name = Item(item):getName():split('+')
     if (#name == 1) then
       return 0
     end
  
     return math.abs(name[2])
  end,
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
   local it = ItemType(itemEx.itemid)
  if((it:getWeaponType() > 0 or getItemAttribute(itemEx.uid, ITEM_ATTRIBUTE_ARMOR) > 0) and not isItemStackable(itemEx.itemid))then
  local level = upgrading.getLevel(itemEx.uid)
  if(level < #conf["level"])then
  local nLevel = (conf["level"][(level+1)].successPercent >= math.random(1,100)) and (level+1) or conf["level"][level].downgradeLevel
  if(nLevel > level)then
  doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN)
  doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Upgrade to level " .. nLevel .. " successful!")
  else
  doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
  doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Upgrade failed. Your " .. it:getName() .. " is now on level " .. nLevel .. "")
  end
  doItemSetAttribute(itemEx.uid, ITEM_ATTRIBUTE_NAME, it:getName()..((nLevel>0) and "+"..nLevel or ""))
  doItemSetAttribute(itemEx.uid, ITEM_ATTRIBUTE_ATTACK,  upgrading.upValue(it:getAttack(), nLevel, conf["upgrade"].attack))
  doItemSetAttribute(itemEx.uid, ITEM_ATTRIBUTE_DEFENSE, upgrading.upValue(it:getDefense(), nLevel, conf["upgrade"].defense))
  doItemSetAttribute(itemEx.uid, ITEM_ATTRIBUTE_EXTRADEFENSE, upgrading.upValue(it:getExtraDefense(), nLevel, conf["upgrade"].extraDefense))
  doItemSetAttribute(itemEx.uid, ITEM_ATTRIBUTE_ARMOR, upgrading.upValue(it:getArmor(), nLevel, conf["upgrade"].armor))
  doItemSetAttribute(itemEx.uid, ITEM_ATTRIBUTE_HITCHANCE, upgrading.upValue(it:getHitChance(), nLevel, conf["upgrade"].hitChance))
  doRemoveItem(item.uid, 1)
  else
  doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your " .. it:getName() .. " is on max level alredy.")
  end
  else
  doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You cannot upgrade this item.")
  end
end

tenta esse no meu esta perfeito

 

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo