• 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!

Error NPC interface!

J-Crasher

New Member
Joined
Oct 8, 2013
Messages
8
Reaction score
0
When i compile i get this error of all my npc's
One of the hundred errors....
Code:
[16/10/2013 22:04:20] [Error - Npc interface]
[16/10/2013 22:04:20] data/npc/scripts/Atrad.lua
[16/10/2013 22:04:20] Description:
[16/10/2013 22:04:20] data/npc/scripts/Atrad.lua:1: attempt to index global 'KeywordHandler' (a nil value)
[16/10/2013 22:04:20] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/Atrad.lua

Can someone help me with this?

EDIT: I use TheForgottenServer version 0.3.6 (Crying Damson)
 
Last edited:
What did you change and which server do you use?
This error means it can't find the npcsystem with the directory you have in the npc.lua/npcsystem.lua (data/npc/lib)
 
Works whit http://otland.net/threads/error-npc-interface.200135/
Thanks. :]
but i have a new error, follow

Code:
[16/07/2014 20:28:03] [Error - Spell Interface]
[16/07/2014 20:28:03] data/spells/scripts/monster/feversleep skill reducer.lua
[16/07/2014 20:28:03] Description:
[16/07/2014 20:28:03] .../spells/scripts/monster/feversleep skill reducer.lua:1: attempt to call global 'Combat' (a nil value)
[16/07/2014 20:28:03] [Warning - Event::loadScript] Cannot load script (data/spells/scripts/monster/feversleep skill reducer.lua)

:D
 
If you have errors, post the script and if your problem is not related to the thread, you can just create a new thread.
 
New error here, i add one npc "UzonE"

and apear this error
Code:
[16/07/2014 23:07:48] [Error - Npc interface]
[16/07/2014 23:07:48] data/npc/scripts/UzonE.lua:onThink
[16/07/2014 23:07:48] Description:
[16/07/2014 23:07:48] data/npc/scripts/UzonE.lua:13: attempt to call global 'Npc' (a nil value)
[16/07/2014 23:07:48] stack traceback:
[16/07/2014 23:07:48]     data/npc/scripts/UzonE.lua:13: in function <data/npc/scripts/UzonE.lua:9>

Follow the script
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)            npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)        npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)        npcHandler:onCreatureSay(cid, type, msg)        end
local rnd_sounds = 0
function onThink()
    if(rnd_sounds < os.time()) then
        rnd_sounds = (os.time() + 5)
        if(math.random(100) < 25) then
            Npc():say("Feel the wind in your hair during one of my carpet rides!", TALKTYPE_SAY)
        end
    end
    npcHandler:onThink()
end

keywordHandler:addKeyword({'name'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I am known as Uzon Ibn Kalith."})
keywordHandler:addKeyword({'passage'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "You'll have to leave this unholy place first!"})
keywordHandler:addKeyword({'transport'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "You'll have to leave this unholy place first!"})
keywordHandler:addKeyword({'ride'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "You'll have to leave this unholy place first!"})
keywordHandler:addKeyword({'trip'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "You'll have to leave this unholy place first!"})

local function creatureSayCallback(cid, type, msg)
    local player = Player(cid)
    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isInArray({"back", "leave", "passage"}, msg) then
        npcHandler:say('Do you really want to leave this unholy place?', cid)
        npcHandler.topic[cid] = 1
    elseif(msgcontains(msg, "yes")) then
        if(npcHandler.topic[cid] == 1) then
            player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
            player:teleportTo({x = 32535, y = 31837, z = 4}, false)
            player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
            npcHandler:say('So be it!', cid)
            npcHandler.topic[cid] = 0
        end
    end
    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:setMessage(MESSAGE_GREET, "Daraman's blessings, traveller |PLAYERNAME|.")
npcHandler:setMessage(MESSAGE_FAREWELL, "Daraman's blessings")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Daraman's blessings")
npcHandler:addModule(FocusModule:new())
 
I know not to do that, then I will remove the NPCs that are giving error

como faço para encontrar os npcs?
ele fazem parte de uma quest em kazz
NPC Rapanaio1
NPC Rapanaio2
e tambem falta um npc que fica embaixo dos quara em yalahar
NPC Maritima.

Follow the errors
Code:
[17/07/2014 08:34:43] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/Maritima.xml).
[17/07/2014 08:34:43] Info: failed to load external entity "data/npc/Maritima.xml"


[17/07/2014 08:34:43] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/Rapanaio.xml).
[17/07/2014 08:34:43] Info: failed to load external entity "data/npc/Rapanaio.xml"


[17/07/2014 08:34:43] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/Rapanaio1.xml).
[17/07/2014 08:34:43] Info: failed to load external entity "data/npc/Rapanaio1.xml"
 
Not sure what you just posted, my Portuguese isn't very good, but that error means you don't have those npcs in the folder data/npc in the datapack of your server.
 
arry about that,

"
how do I find the npcs?
it is part of a quest for kazz
NPC Rapanaio1
NPC Rapanaio2
and also lack an NPC that is below the quara in yalahar"
 
Back
Top