• 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 Sebastian NPC TFS 1.2

Xaqiion

New Member
Joined
May 8, 2015
Messages
11
Reaction score
1
Hi.

I need help with this one.
Ive got this error before and i couldnt solve it.
Now i updated the server from TFS 1.1 and the NPC that used to have this error dont have it any more.
But now Sebastian has it.

Code:
Lua Script Error: [Npc interface]
data/npc/scripts/Sebastian.lua:onCreatureSay
data/npc/lib/npcsystem/modules.lua:62: attempt to compare number with table
stack traceback:
        [C]: in function '__lt'
        data/npc/lib/npcsystem/modules.lua:62: in function 'callback'
        data/npc/lib/npcsystem/keywordhandler.lua:31: in function 'processMessag
e'
        data/npc/lib/npcsystem/keywordhandler.lua:190: in function 'processNodeM
essage'
        data/npc/lib/npcsystem/keywordhandler.lua:163: in function 'processMessa
ge'
        data/npc/lib/npcsystem/npchandler.lua:427: in function 'onCreatureSay'
        data/npc/scripts/Sebastian.lua:7: in function <data/npc/scripts/Sebastia
n.lua:7>

Can anyone tell me whats doing this.
Is there a function i should change in the script?
Is the script using old functions so i need to add something in the lib?
I am totaly lost at the moment.
 
sebastian.lua
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
function onThink()                npcHandler:onThink()                    end

-- Travel
local function addTravelKeyword(keyword, text, cost, destination)
    local travelKeyword = keywordHandler:addKeyword({keyword}, StdModule.say, {npcHandler = npcHandler, text = 'Do you want to sail ' .. keyword:titleCase() .. ' for |TRAVELCOST|?', cost = cost, discount = 'postman'})
        travelKeyword:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, cost = cost, discount = 'postman', destination = destination})
        travelKeyword:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, text = 'We would like to serve you some time.', reset = true})
end

addTravelKeyword('liberty bay', 50, Position(32349, 32856, 7))
addTravelKeyword('nargor', 50, Position(32024, 32813, 7))

-- Basic
keywordHandler:addKeyword({'passage'}, StdModule.say, {npcHandler = npcHandler, text = 'Where do you want to go? To {Liberty bay} or to {Nargor}?'})
keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, text = 'I am the captain of this ship.'})
keywordHandler:addKeyword({'captain'}, StdModule.say, {npcHandler = npcHandler, text = 'I am the captain of this ship.'})

npcHandler:setMessage(MESSAGE_GREET, "Greetings, daring adventurer. If you need a {passage}, let me know.")
npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye.")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Oh well.")

npcHandler:addModule(FocusModule:new())

When im thinking of it can it be that
addTravelKeyword is missing a parameter?
Think i will change
addTravelKeyword('liberty bay', 50, Position(32349, 32856, 7)) to addTravelKeyword('liberty bay', '', 50, Position(32349, 32856, 7))

Do think that could work?
 
Back
Top