Postado Janeiro 19, 2015 10 anos Olá boa noite, venho aqui informar um erro que aparece no distro do servidor toda vez em que o player verifica suas Blessings pelos seguintes itens: Ornamented Brooch id: 12385 e Ceremoniak Ankh id: 6561 O erro no distro é o seguinte, toda vez que o player da Use no item aparece corretamente 100% as informações se ele possui alguma bless, quais.. e até se não possui nenhuma, o erro é esse: [19/01/2015 20:27:47] [Error - Action Interface] [19/01/2015 20:27:47] data/actions/scripts/other/checkblessings.lua:onUse [19/01/2015 20:27:47] Description: [19/01/2015 20:27:47] (luaGetPlayerBlessing) Player not found o sistema de bless que eu possuo é por charms em Actions/scripts/other/checkblessings.lua está assim: local BLESSINGS = {"Wisdom of Solitude", "Spark of the Phoenix", "Fire of the Suns", "Spiritual Shielding", "Embrace of Tibia", "Twist of Fate"} function onUse(cid, item, fromPosition, itemEx, toPosition) local result = "" for i = 1, (table.maxn(BLESSINGS) - 1) do result = (getPlayerBlessing(cid, i) and result .. (result:len() > 0 and ", " or "") .. BLESSINGS or result) end if(getPlayerBlessing(cid) == table.maxn(BLESSINGS) - 1) then result = result .. ", " .. BLESSINGS[table.maxn(BLESSINGS)] end return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, result:len() > 0 and "Currently you have the following blessings: " .. result .. "." or "You do not have any blessing.") end e em actions/actions.xml está assim: <action itemid="6561" script="other/checkblessings.lua"/> <action itemid="12385" script="other/checkblessings.lua"/> e tenho tbm a script de blessings, que é responsável pelas charms, acho que o erro não está nela, mas está aqui pra qualquer coisa.. actions/actions.xml <action fromid="11252" toid="11256" script="other/blessings.lua"/> -- Blessings actions/scripts/other/blessings.lua: function onUse(cid, item, fromPosition, itemEx, toPosition) if(itemEx.itemid == 11256) then if(getPlayerBlessing(cid, 1)) then doPlayerSendCancel(cid, "You already have been blessed with the Wisdom of Solitude.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) else doPlayerAddBlessing(cid, 1) doRemoveItem(item.uid, 1) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have recived the Wisdom of Solitude.") end elseif(itemEx.itemid == 11252) then if(getPlayerBlessing(cid, 2)) then doPlayerSendCancel(cid, "You already have been blessed with the Spark of the Phoenix.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) else doPlayerAddBlessing(cid, 2) doRemoveItem(item.uid, 1) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have recived the Spark of the Phoenix.") end elseif(itemEx.itemid == 11255) then if(getPlayerBlessing(cid, 3)) then doPlayerSendCancel(cid, "You already have been blessed with the Fire of the Suns.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) else doPlayerAddBlessing(cid, 3) doRemoveItem(item.uid, 1) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have recived the Fire of the Suns.") end elseif(itemEx.itemid == 11254) then if(getPlayerBlessing(cid, 4)) then doPlayerSendCancel(cid, "You already have been blessed with the Spiritual Shielding.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) else doPlayerAddBlessing(cid, 4) doRemoveItem(item.uid, 1) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have recived the Spiritual Shielding.") end elseif(itemEx.itemid == 11253) then if(getPlayerBlessing(cid, 5)) then doPlayerSendCancel(cid, "You already have been blessed with the Embrace of Tibia.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) else doPlayerAddBlessing(cid, 5) doRemoveItem(item.uid, 1) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have recived the Embrace of Tibia..") end return true end end Alguém sabe porque esse erro no distro acontece toda vez em que o player verifica suas bless através dos 2 itens? Agradeço qualquer ajuda!
Postado Janeiro 19, 2015 10 anos Tenta mudar o checkbless.lua para este : function onUse(cid, item, fromPosition, itemEx, toPosition) local str = {"\nSpiritual Shielding", "\nEmbrace of Tibia", "\nFire of the Suns", "\nSpark of the Phoenix", "\nWisdom of Solitude", "\nTwist of Fate"} local result = "Received blessings:" local player = Player(cid) for i = 1, 6 do result = player:hasBlessing(i) and result .. str[i] or result end player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 20 > result:len() and "No blessings received." or result) return true end Ajudei = REP+ Não dou suporte por PM qualquer dúvida procure no fórum,caso não encontre oque procura crie um tópico. [email protected]" /> | TFS 0.4 DEV | %5Bcreaturescript%5D Icones no minimap com descrição%5Btalkaction%5D Adicionar ou remover VIP do player.%5Bcreaturescripts%5D Senha para porta%5Btalkaction%5D Mandar mensagem para pasta do servidorMapa Evento War Castle%5Baction%5D Canoa em MovimentoTeleport Scroll System%5Bcreaturescripts%5D Recompensa por level para X vocations%5Btalkaction%5D Adicionar X item para o player%5Btalkactions%5D Adicionar item para todos players online%5Baction%5D Item que teleporta o player para house[action+movement] Passaporte para entrar no barco
Postado Janeiro 19, 2015 10 anos Autor deu este erro e não diz mais quantos bless possui.. [19/01/2015 21:46:20] [Error - Action Interface] [19/01/2015 21:46:20] data/actions/scripts/other/checkblessings.lua:onUse [19/01/2015 21:46:20] Description: [19/01/2015 21:46:20] data/actions/scripts/other/checkblessings.lua:4: attempt to call global 'Player' (a nil value) [19/01/2015 21:46:20] stack traceback: [19/01/2015 21:46:20] data/actions/scripts/other/checkblessings.lua:4: in function <data/actions/scripts/other/checkblessings.lua:1>
Postado Janeiro 19, 2015 10 anos Qual versão do seu servidor e qual TFS você ta usando ? Ajudei = REP+ Não dou suporte por PM qualquer dúvida procure no fórum,caso não encontre oque procura crie um tópico. [email protected]" /> | TFS 0.4 DEV | %5Bcreaturescript%5D Icones no minimap com descrição%5Btalkaction%5D Adicionar ou remover VIP do player.%5Bcreaturescripts%5D Senha para porta%5Btalkaction%5D Mandar mensagem para pasta do servidorMapa Evento War Castle%5Baction%5D Canoa em MovimentoTeleport Scroll System%5Bcreaturescripts%5D Recompensa por level para X vocations%5Btalkaction%5D Adicionar X item para o player%5Btalkactions%5D Adicionar item para todos players online%5Baction%5D Item que teleporta o player para house[action+movement] Passaporte para entrar no barco
Postado Janeiro 20, 2015 10 anos Autor 0.4.1 tfs servidor 8.60 Editado Janeiro 20, 2015 10 anos por victorat (veja o histórico de edições)
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.