É galera, desculpem, sei que tem outros posts parecidos, porém, não consigo fazer funcionar botões que usam items em geral...
Aqui está meu código.lua, neste caso estou tentando abrir a bolsa com um button usando toggle.
local bolsaButton
function init()
g_keyboard.bindKeyDown('Ctrl+A', toggle)
bolsaButton = modules.client_topmenu.addRightGameToggleButton('bolsaButton', tr('Bolsa') .. ' (Ctrl+A)', '/images/ui/pokebag', toggle)
end
function toggle ()
if bolsaButton:isOn() then
bolsaButton:setOn(false)
g_game.useInventoryItem(1987)
else
bolsaButton:setOn(true)
g_game.useInventoryItem(1987)
end
end
Não da erro nenhum no terminal do OTC, simplesmente, quando clico no botão aparece na tela de jogo a mensagem branca dizendo: "Sorry, not possible."
Pergunta
morphsx 0
É galera, desculpem, sei que tem outros posts parecidos, porém, não consigo fazer funcionar botões que usam items em geral...
Aqui está meu código.lua, neste caso estou tentando abrir a bolsa com um button usando toggle.
local bolsaButton function init() g_keyboard.bindKeyDown('Ctrl+A', toggle) bolsaButton = modules.client_topmenu.addRightGameToggleButton('bolsaButton', tr('Bolsa') .. ' (Ctrl+A)', '/images/ui/pokebag', toggle) end function toggle () if bolsaButton:isOn() then bolsaButton:setOn(false) g_game.useInventoryItem(1987) else bolsaButton:setOn(true) g_game.useInventoryItem(1987) end endNão da erro nenhum no terminal do OTC, simplesmente, quando clico no botão aparece na tela de jogo a mensagem branca dizendo: "Sorry, not possible."
Link para o comentário
https://xtibia.com/forum/topic/215657-bot%C3%A3o-para-abrir-a-bag/Compartilhar em outros sites
3 respostass a esta questão
Posts Recomendados
Arquivado
Este tópico foi arquivado e está fechado para novas respostas.