• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[NPC] modules.lua issue

Blasphemy

Well-Known Member
Joined
Jan 5, 2012
Messages
387
Reaction score
67
Hi everyone!

I got this error at console, which means there are few npcs (actually 3) with problems... didn't detected yet.
Code:
[5/3/2020 14:56:26] [Error - NpcScript Interface]
[5/3/2020 14:56:26] data/npc/scripts/default.lua
[5/3/2020 14:56:26] Description:
[5/3/2020 14:56:26] data/npc/lib/npcsystem/modules.lua:1072: attempt to index local 'v' (a boolean value)
[5/3/2020 14:56:26] [Warning - NpcEvents::NpcEvents] Cannot load script: data/npc/scripts/default.lua

There's my modules.lua file.

I'm using OTX 7.72

Thanks for helping <3
 

Attachments

Add the following under line #1039
Lua:
if not v then
    print("[ERROR] Invalid item id " .. itemid)
    return false
end

While it might not be a fix, it will give you more insight
 
Add the following under line #1039
Lua:
if not v then
    print("[ERROR] Invalid item id " .. itemid)
    return false
end

While it might not be a fix, it will give you more insight


Cool, default.lua errors disappear but there came this other:

Code:
[5/3/2020 19:50:8] [Error - NpcScript Interface]
[5/3/2020 19:50:8] data/npc/scripts/mirabell.lua
[5/3/2020 19:50:8] Description:
[5/3/2020 19:50:8] data/npc/lib/npcsystem/modules.lua:1041: attempt to concatenate local 'itemid' (a nil value)
[5/3/2020 19:50:8] [Warning - NpcEvents::NpcEvents] Cannot load script: data/npc/scripts/mirabell.lua

[5/3/2020 19:50:9] [ERROR] Invalid item id 7906
[5/3/2020 19:50:9] [ERROR] Invalid item id 7905
[5/3/2020 19:50:9] [ERROR] Invalid item id 7904
[5/3/2020 19:50:9] [ERROR] Invalid item id 7907
[5/3/2020 19:50:9] [ERROR] Invalid item id 6115
[5/3/2020 19:50:9] [ERROR] Invalid item id 8692
[5/3/2020 19:50:9] [ERROR] Invalid item id 7700
[5/3/2020 19:50:9] [ERROR] Invalid item id 7962
[5/3/2020 19:50:9] [ERROR] Invalid item id 7936
[5/3/2020 19:50:9] [ERROR] Invalid item id 8368
[5/3/2020 19:50:9] [ERROR] Invalid item id 8111
[5/3/2020 19:50:9] [ERROR] Invalid item id 8368
[5/3/2020 19:50:9] [ERROR] Invalid item id 8111
 

Attachments

Replace what you added with this:
Code:
        if not v then
            local err_itemid = itemid == nil and "_no_id_" or itemid
            local real_name = realName == nil and "_no_name_" or realName
            return print("[ERROR] Invalid item id [" .. err_itemid .. "] - [" .. real_name .."]")
        end
 
Replace what you added with this:
Code:
        if not v then
            local err_itemid = itemid == nil and "_no_id_" or itemid
            local real_name = realName == nil and "_no_name_" or realName
            return print("[ERROR] Invalid item id [" .. err_itemid .. "] - [" .. real_name .."]")
        end

FFFFFFFFFF
XD

1583460230307.png
 
You could figure out why those items dont exist, or remove them from the NPCs sale list or remove the print() and go on with your life
 
Solution
You could figure out why those items dont exist, or remove them from the NPCs sale list or remove the print() and go on with your life

Yeah, haha actually, I'm getting back the past code u gave me, and I'll search npc by npc where are they located haha :*!!! very grateful!
I love you
 
You could search your entire server npc directory for one of those items (I recommend stone skin, not too many NPCs sell it), if your using notepad ++. Just do CTRL +F and then select “Find in files”, put in your server npc directory location and your good to go . Should expedite the search process
 
Back
Top