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

Lua NPC Won't Respond (TibianTime Nil)

AngeloFuturo

Scan QR for free money.
Joined
Mar 29, 2008
Messages
77
Reaction score
6
Location
Who's asking?
Hi!

Everything else in my server is working except for when I walk up to an NPC (any NPC) and say "hi".

That's when I get the following error in console:

Lua Script Error: [Main Interface]
in a timer event called from:
(Unknown scriptfile)
data/npc/lib/npcsystem/npchandler.lua:643: attempt to call global 'getTibianTime' (a nil value)
stack traceback:
[C]: in function 'getTibianTime'
data/npc/lib/npcsystem/npchandler.lua:643: in function <data/npc/lib/npcsystem/npchandler.lua:635>

I have the "Jiddo" version of npchandler in case you wonder.

Help!

/A
 
Last edited:
For reference, here is the last few lines that seem to cause an error (starting at line 3)

Lua:
local player = Player(focusId)
            if player then
                local parseInfo = {[TAG_PLAYERNAME] = player:getName(), [TAG_TIME] = getTibianTime(), [TAG_BLESSCOST] = getBlessingsCost(player:getLevel()), [TAG_PVPBLESSCOST] = getPvpBlessingCost(player:getLevel())}
                npc:say(self:parseMessage(message, parseInfo), TALKTYPE_PRIVATE_NP, false, player, npc:getPosition())
            end
        end, self.talkDelayTime * 1000, Npc().uid, message, focus)
    end
 
You seem to lack the function getTibianTime()

Try change it to

getFormattedWorldTime()

Not sure if it helps tho!
 
Hey man! Thanks, it worked!

But now...

Lua Script Error: [Main Interface]
in a timer event called from:
(Unknown scriptfile)
data/npc/lib/npcsystem/npchandler.lua:643: attempt to call global 'getBlessingsCost' (a nil value)
stack traceback:
[C]: in function 'getBlessingsCost'
data/npc/lib/npcsystem/npchandler.lua:643: in function <data/npc/lib/npcsystem/npchandler.lua:635>

EDIT:

Code now looks like this:

Lua:
local parseInfo = {[TAG_PLAYERNAME] = player:getName(), [TAG_TIME] = getFormattedWorldTime(), [TAG_BLESSCOST] = getBlessingsCost(player:getLevel()), [TAG_PVPBLESSCOST] = getPvpBlessingCost(player:getLevel())}
                npc:say(self:parseMessage(message, parseInfo), TALKTYPE_PRIVATE_NP, false, player, npc:getPosition())
            end
        end, self.talkDelayTime * 1000, Npc().uid, message, focus)
    end
 
That's why you should state what server version are you using and what you did before it broke in your very first post.
You've probably copied a part of a data from one distro to another, because you are missing functions.
Swap your npcsystem for the one that is originally on TFS you are using or go to the one you copied files from and look for functions that are missing. (In this case getBlessingsCost)
 
God damn it. Now this, when I try to deposit money in bank:

Lua Script Error: [Npc interface]
data/npc/scripts/Naji.lua:eek:nCreatureSay
data/npc/scripts/Naji.lua:102: attempt to call method 'depositMoney' (a nil value)
stack traceback:
[C]: in function 'depositMoney'
data/npc/scripts/Naji.lua:102: in function 'callback'
data/npc/lib/npcsystem/npchandler.lua:411: in function 'onCreatureSay'
data/npc/scripts/Naji.lua:10: in function <data/npc/scripts/Naji.lua:10>

TFS 1.2, latest release. So is the NPC pack.
 
God damn it. Now this, when I try to deposit money in bank:



TFS 1.2, latest release. So is the NPC pack.
Like i said, go to the server data you copied files from and search the folder for missing function. You can copy them to global.lua.
If there are whole lib files you can copy them all somewhere to lib folder and then you edit data/lib/lib.lua and add new 'dofile()' lines with directories.
 
Back
Top