ralke
(҂ ͠❛ ෴ ͡❛)ᕤ
Hi! I use Nekiro 8.6 1.4 tfs and need some help. I'm working with this code TFS 1.X+ - Problem with target:getMonster() function (https://otland.net/threads/problem-with-target-getmonster-function.277284/), it is working great. But I have a trouble, when you perform the verification correctly, the channel is not getting closed. I tried to add this function to the chatchannel/antibot.lua
After
In this way
But I have this error, how can I achieve this? If the channel doesn't get closed and it remain open the next verfication doesn't send the new question and that's why I need to close the channel as soon the verification is correct (the channel also has a system that doesn't allow to open it manually).
The only thread I could find with this was Solved - close channel network message (https://otland.net/threads/close-channel-network-message.248417/) Hope you can help me!
Thanks in advance
Code:
player:closeChannel(ANTI_BOT_SYSTEM.config.channelId)
After
Code:
player:sendChannelMessage("", ANTI_BOT_SYSTEM.messages.correct_answer.msg
In this way
Code:
if message ~= ANTI_BOT_SYSTEM.questions[ANTI_BOT_SYSTEM.cache.question].answer then
addEvent(function() player:sendChannelMessage("", ANTI_BOT_SYSTEM.messages.wrong_answer.msg, ANTI_BOT_SYSTEM.messages.wrong_answer.type, ANTI_BOT_SYSTEM.config.channelId) end, 300)
else
addEvent(function() player:sendChannelMessage("", ANTI_BOT_SYSTEM.messages.correct_answer.msg, ANTI_BOT_SYSTEM.messages.correct_answer.type, ANTI_BOT_SYSTEM.config.channelId) end, 300)
player:closeChannel(ANTI_BOT_SYSTEM.config.channelId)
ANTI_BOT_SYSTEM.cache.players[player:getId()] = nil
end
But I have this error, how can I achieve this? If the channel doesn't get closed and it remain open the next verfication doesn't send the new question and that's why I need to close the channel as soon the verification is correct (the channel also has a system that doesn't allow to open it manually).
The only thread I could find with this was Solved - close channel network message (https://otland.net/threads/close-channel-network-message.248417/) Hope you can help me!
Thanks in advance