FapFap 13 Report post Posted August 24, 2018 I'm having a error at lua_err spamming almost all the time when dw gets on, im using a dw boss checker if dw boss 1 is dead then you be able to go to dw 2 and im having this error at lua_err (but script works fine) it's just this error that keeps spamming: lua_err.txt: Function.lua: Quote Share this post Link to post Share on other sites
iZae 55 Report post Posted August 25, 2018 replace 2310 line to: if Hp(role)<=0 or Hp(role)==nil then 1 Quote Share this post Link to post Share on other sites
FapFap 13 Report post Posted August 25, 2018 5 hours ago, iZae said: replace 2310 line to: if Hp(role)<=0 or Hp(role)==nil then still the same error on same line Quote Share this post Link to post Share on other sites
MonkeyCode 453 Report post Posted August 25, 2018 write test unit with pcall and "assert" Quote Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted August 26, 2018 Check that role is a valid descriptor of monster. Show your script where you use the CheckMonsterDead function. Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
FapFap 13 Report post Posted August 26, 2018 12 hours ago, V3ct0r said: Check that role is a valid descriptor of monster. Show your script where you use the CheckMonsterDead function. I use the script on ctrl.lua at map files to make a check for dw boss, the script works fine but i only getting those errors spamming lua_err.txt Quote Share this post Link to post Share on other sites
FapFap 13 Report post Posted August 26, 2018 14 hours ago, Stinger said: Use this: function CheckMonsterDead(role) if (Hp(role) == nil or Hp(role) <= 0) then -- First of all, always check nil. return 1 end end should i replace my whole function to urs? Quote Share this post Link to post Share on other sites
Inuarashi 5 Report post Posted August 26, 2018 (edited) 2 hours ago, FapFap said: should i replace my whole function to urs? the problem error is that, sometimes it happens that the value hp(role) is nil , and there is nothing to handle that, so the error comes up a way to fix it is to add something to handle that situation. such as the code above. if the value is nil, or the value is less than 0 , do someting, end. Edited August 26, 2018 by Inuarashi Quote Share this post Link to post Share on other sites
MonkeyCode 453 Report post Posted August 27, 2018 the function is not bugged (everyone is using it). You just need to pass in a role. And because you check if the monster is dead inside map_run, it runs every second even if sometimes your variable DWboss1 is "null". Better you go do your actions at GetExp_New / GetExp_PKM, if dead == DWboss1 then DWport1 = 1 end and inside map_close: DWboss1 = nil -- note the nil here (one reason why you could be getting the errors Quote Share this post Link to post Share on other sites
FapFap 13 Report post Posted August 27, 2018 i should add this at getexp_new or getexp_pkm? 1 hour ago, KONG said: Better you go do your actions at GetExp_New / GetExp_PKM, if dead == DWboss1 then DWport1 = 1 end or maybe both Quote Share this post Link to post Share on other sites