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

Errors in script

dawiisss

Ye wanna!!
Joined
Nov 30, 2008
Messages
161
Reaction score
0
Location
United Kingdom
Hi i created a npc for rodrigosh and he got this error:

[11/01/2010 15:08:38] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/palleq.lua
[11/01/2010 15:08:38] data/npc/scripts/palleq.lua:32: '<eof>' expected near 'end'
[11/01/2010 15:13:33] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/knighteq.lua
[11/01/2010 15:13:33] data/npc/scripts/knighteq.lua:31: '<eof>' expected near 'end'

The two scripts are...

knighteq.lua

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end
function onThink() npcHandlernThink() end

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

shopModule:addBuyableItem({'demon helmet'}, 3387, 0, 'demon helmet')
shopModule:addBuyableItem({'golden legs'}, 3364, 0, 'golden legs')
shopModule:addBuyableItem({'mpa'}, 3366, 0, 'mpa')
shopModule:addBuyableItem({'mms'}, 3414, 0, 'mms')
shopModule:addBuyableItem({'boh'}, 3079, 0, 'boh')
shopModule:addBuyableItem({'emerald sword'}, xxx, 0, 'emerald sword')
shopModule:addBuyableItem({'thunder hammer'}, 3309, 0, 'thunder hammer')
shopModule:addBuyableItem({'hellforged axe'}, xxx, 0, 'hellforged axe')

local items = {[1] = 3387, [2] = 3364, [5] = 3366, [6] = 3414}
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
end

return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

and palleq.lua

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end
function onThink() npcHandlernThink() end

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

shopModule:addBuyableItem({'demon helmet'}, 3387, 0, 'demon helmet')
shopModule:addBuyableItem({'yalahari legs'}, xxxx, 0, 'yalahari legs')
shopModule:addBuyableItem({'mpa'}, 3366, 0, 'mpa')
shopModule:addBuyableItem({'mms'}, 3414, 0, 'mms')
shopModule:addBuyableItem({'boh'}, 3079, 0, 'boh')
shopModule:addBuyableItem({'royal crossbow'}, 8023, 0, 'royal crossbow')
shopModule:addBuyableItem({'assassin star'}, 7368, 0, 100, 'assassin star')
shopModule:addBuyableItem({'infernal bolt'}, 6528, 0, 100,'infernal bolt')

local items = {[1] = 3387, [2] = 3366, [5] = 3079, [6] = 3414}
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
end

return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

I am not advanced in LUA so don't know the error..
 
knighteq.lua
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end
function onThink() npcHandlernThink() end

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

shopModule:addBuyableItem({'demon helmet'}, 3387, 0, 'demon helmet')
shopModule:addBuyableItem({'golden legs'}, 3364, 0, 'golden legs')
shopModule:addBuyableItem({'mpa'}, 3366, 0, 'mpa')
shopModule:addBuyableItem({'mms'}, 3414, 0, 'mms')
shopModule:addBuyableItem({'boh'}, 3079, 0, 'boh')
shopModule:addBuyableItem({'emerald sword'}, xxx, 0, 'emerald sword')
shopModule:addBuyableItem({'thunder hammer'}, 3309, 0, 'thunder hammer')
shopModule:addBuyableItem({'hellforged axe'}, xxx, 0, 'hellforged axe')

local items = {[1] = 3387, [2] = 3364, [5] = 3366, [6] = 3414}
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

palleq.lua
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end
function onThink() npcHandlernThink() end

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

shopModule:addBuyableItem({'demon helmet'}, 3387, 0, 'demon helmet')
shopModule:addBuyableItem({'yalahari legs'}, xxxx, 0, 'yalahari legs')
shopModule:addBuyableItem({'mpa'}, 3366, 0, 'mpa')
shopModule:addBuyableItem({'mms'}, 3414, 0, 'mms')
shopModule:addBuyableItem({'boh'}, 3079, 0, 'boh')
shopModule:addBuyableItem({'royal crossbow'}, 8023, 0, 'royal crossbow')
shopModule:addBuyableItem({'assassin star'}, 7368, 0, 100, 'assassin star')
shopModule:addBuyableItem({'infernal bolt'}, 6528, 0, 100,'infernal bolt')

local items = {[1] = 3387, [2] = 3366, [5] = 3079, [6] = 3414}
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end


return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Maybe... oO
 
[11/01/2010 18:52:53] [Error - Npc interface]
[11/01/2010 18:52:53] (Unknown script file)
[11/01/2010 18:52:53] Description:
[11/01/2010 18:52:53] data/npc/lib/npcsystem/modules.lua:1151: bad argument #2 to 'error' (number expected, got string)
[11/01/2010 18:52:53] stack traceback:
[11/01/2010 18:52:53] [C]: in function 'error'
[11/01/2010 18:52:53] data/npc/lib/npcsystem/modules.lua:1151: in function 'callbackOnBuy'
[11/01/2010 18:52:53] data/npc/lib/npcsystem/npchandler.lua:263: in function 'processModuleCallback'
[11/01/2010 18:52:53] data/npc/lib/npcsystem/npchandler.lua:440: in function 'onBuy'
[11/01/2010 18:52:53] data/npc/lib/npcsystem/modules.lua:1292: in function <data/npc/lib/npcsystem/modules.lua:1291>

what is wrong??

and 1 thing more when I try to buy a wand it doesn't work

what is wrong??
 
Knight

Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end
function onThink() npcHandlernThink() end

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

shopModule:addBuyableItem({'demon helmet'}, 3387, 0, 1, 'demon helmet')
shopModule:addBuyableItem({'golden legs'}, 3364, 0, 1, 'golden legs')
shopModule:addBuyableItem({'mpa'}, 3366, 0, 1, 'mpa')
shopModule:addBuyableItem({'mms'}, 3414, 0, 1, 'mms')
shopModule:addBuyableItem({'boh'}, 3079, 0, 1, 'boh')
shopModule:addBuyableItem({'emerald sword'}, xxx, 0, 1, 'emerald sword')
shopModule:addBuyableItem({'thunder hammer'}, 3309, 0, 1, 'thunder hammer')
shopModule:addBuyableItem({'hellforged axe'}, xxx, 0, 1, 'hellforged axe')

local items = {[1] = 3387, [2] = 3364, [5] = 3366, [6] = 3414}
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
end

return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Paladin
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end
function onThink() npcHandlernThink() end

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

shopModule:addBuyableItem({'demon helmet'}, 3387, 0, 1, 'demon helmet')
shopModule:addBuyableItem({'yalahari legs'}, xxxx, 0, 1, 'yalahari legs')
shopModule:addBuyableItem({'mpa'}, 3366, 0, 1, 'mpa')
shopModule:addBuyableItem({'mms'}, 3414, 0, 1, 'mms')
shopModule:addBuyableItem({'boh'}, 3079, 0, 1, 'boh')
shopModule:addBuyableItem({'royal crossbow'}, 8023, 0, 1, 'royal crossbow')
shopModule:addBuyableItem({'assassin star'}, 7368, 0, 100, 'assassin star')
shopModule:addBuyableItem({'infernal bolt'}, 6528, 0, 100,'infernal bolt')

local items = {[1] = 3387, [2] = 3366, [5] = 3079, [6] = 3414}
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
end

return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
The same thing..

[11/01/2010 21:14:22] [Error - LuaScriptInterface::loadFile] data/npc/scripts/palleq.lua:31: '<eof>' expected near 'end'
[11/01/2010 21:14:22] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/palleq.lua
[11/01/2010 21:14:22] data/npc/scripts/palleq.lua:31: '<eof>' expected near 'end'
[11/01/2010 21:14:27] [Error - LuaScriptInterface::loadFile] data/npc/scripts/knighteq.lua:31: '<eof>' expected near 'end'
[11/01/2010 21:14:27] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/knighteq.lua
[11/01/2010 21:14:27] data/npc/scripts/knighteq.lua:31: '<eof>' expected near 'end'
 
Back
Top