dawiisss
Ye wanna!!
Hi i created a npc for rodrigosh and he got this error:
The two scripts are...
knighteq.lua
and palleq.lua
I am not advanced in LUA so don't know the 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..