Jump to content

LUA_ERROR: attempt to call global `table_contains_keyword' (a nil value)


Recommended Posts

Hi guys,

I'm struggling for couple of hours to install the Boss Library posted by Syreldar on this forum.

 

Well... whenever I kill a boss from "Boss.GetData = function", let's say "1304 - Yellow Tiger Ghost" I've got that LUA error.

Then I saw the link from the library about "table_contains_keyword" and I added on bosskillLibrary.lua that I created to put everything there. By the way, I added bosskillLibrary.lua file into questlib.lua as:

dofile(get_locale_base_path().."/quest/luaLibrary/boss_killLibrary.lua")

The functions of table_contains_keyword:

--[[
    Returns:
        true if the 'table_ex' array contains an argument which index keyword is 'keyword',
        else, false.

    Example:
        local table_ex = {
            ["cat"] = 1,
            ["dog"] = 2,
            ["bird"] = 3
        };
        table_contains_keyword(table_ex, "dog"); -> returns true.
        table_contains_keyword(table_ex, "monkey"); -> returns false. -- not found
]]
table_contains_keyword = function(table_ex, keyword)
    return table_ex[keyword] ~= nil;
end -- function

After that, the LUA error disappeared but I still don't have that announcement about someone killing a boss.

notice_all(string.format("[CH%d] %s has slain %s.", pc.get_channel_id(), pc.get_name(), mob_name(race)));

 

Is there anyone able to tell me what I did wrong and how to sort this out, please?

Thank you!

Edited by Calypso2
Link to comment
Share on other sites

  • Premium

The quest by default has a check for GMs.

DKqkjB7.png

If you want to trigger it as GM (keep in mind that in TEST_SERVER everyone is considered a GM), remove the first condition, otherwise, everything works as it should.

x2gTfym.png

  • Love 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

18 minutes ago, Syreldar said:

The quest by default has a check for GMs.

DKqkjB7.png

If you want to trigger it as GM (keep in mind that in TEST_SERVER everyone is considered a GM), remove the first condition, otherwise, everything works as it should.

x2gTfym.png

I'd like to say thank you for your reply. 

Yes, that was the "problem". My mistake because I didn't check that.

Everything works perfect as it should!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.