hi this is a example of my script! and this give me error
[error npc-script interface]
unknown script file
attemp to call a nill value
stack traceback
[error npc-script interface]
unknown script file
attemp to call a nill value
stack traceback
PHP:
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
function creatureSayCallback(cid, type, msg)
if (not npcHandler:isFocused(cid)) then
return false
end
if msgcontains(msg, 'thais') and not isPlayerPzLocked(cid) then
if doPlayerRemoveMoney(cid, 100) == true then
doTeleportThing(cid,{x=32310, y=32209, z=6})
self:releaseFocus(cid)
else
npcHandler:say('You don\'t have enought money to travel!', cid)
self:releaseFocus(cid)
end
end
if msgcontains(msg, 'carlin') and not isPlayerPzLocked(cid) then
if doPlayerRemoveMoney(cid, 100) == true then
doTeleportThing(cid,{x=32387, y=31820, z=6})
self:releaseFocus(cid)
else
npcHandler:say('You don\'t have enought money to travel!', cid)
self:releaseFocus(cid)
end
end
if msgcontains(msg, 'ab\'dendriel) and not isPlayerPzLocked(cid) then
if doPlayerRemoveMoney(cid, 100) == true then
doTeleportThing(cid,{x=32734, y=31668, z=6})
self:releaseFocus(cid)
else
npcHandler:say('You don\'t have enought money to travel!', cid)
self:releaseFocus(cid)
end
end
if msgcontains(msg, 'edron') and not isPlayerPzLocked(cid) then
if doPlayerRemoveMoney(cid, 100) == true then
doTeleportThing(cid,{x=33173, y=31764, z=6})
self:releaseFocus(cid)
else
npcHandler:say('You don\'t have enought money to travel!', cid)
self:releaseFocus(cid)
end
end
if msgcontains(msg, 'venore') and not isPlayerPzLocked(cid) then
if doPlayerRemoveMoney(cid, 100) == true then
doTeleportThing(cid,{x=32954, y=32022, z=6})
self:releaseFocus(cid)
else
npcHandler:say('You don\'t have enought money to travel!', cid)
self:releaseFocus(cid)
end
end
if msgcontains(msg, 'port hope') and not isPlayerPzLocked(cid) then
if doPlayerRemoveMoney(cid, 100) == true then
doTeleportThing(cid,{x=32527, y=32784, z=6})
self:releaseFocus(cid)
else
npcHandler:say('You don\'t have enought money to travel!', cid)
self:releaseFocus(cid)
end
end
if msgcontains(msg, 'svargrond') and not isPlayerPzLocked(cid) then
if doPlayerRemoveMoney(cid, 100) == true then
doTeleportThing(cid,{x=32341, y=31108, z=6})
self:releaseFocus(cid)
else
npcHandler:say('You don\'t have enought money to travel!', cid)
self:releaseFocus(cid)
end
end
if msgcontains(msg, 'liberty bay') and not isPlayerPzLocked(cid) then
if doPlayerRemoveMoney(cid, 100) == true then
doTeleportThing(cid,{x=32285, y=32892, z=6})
self:releaseFocus(cid)
else
npcHandler:say('You don\'t have enought money to travel!', cid)
self:releaseFocus(cid)
end
end
if msgcontains(msg, 'yalahar') and not isPlayerPzLocked(cid) then
if doPlayerRemoveMoney(cid, 100) == true then
doTeleportThing(cid,{x=32816, y=31272, z=6})
self:releaseFocus(cid)
else
npcHandler:say('You don\'t have enought money to travel!', cid)
self:releaseFocus(cid)
end
end
if msgcontains(msg, 'oken') and not isPlayerPzLocked(cid) then
if doPlayerRemoveMoney(cid, 100) == true then
doTeleportThing(cid,{x=18165, y=17744, z=6})
self:releaseFocus(cid)
else
npcHandler:say('You don\'t have enought money to travel!', cid)
self:releaseFocus(cid)
end
end
if msgcontains(msg, 'gengia') and not isPlayerPzLocked(cid) then
if doPlayerRemoveMoney(cid, 100) == true then
doTeleportThing(cid,{x=17508, y=17068, z=6})
self:releaseFocus(cid)
else
npcHandler:say('You don\'t have enought money to travel!', cid)
self:releaseFocus(cid)
end
end
if msgcontains(msg, 'pyre') and not isPlayerPzLocked(cid) then
if doPlayerRemoveMoney(cid, 100) == true then
doTeleportThing(cid,{x=18781, y=18518, z=6})
self:releaseFocus(cid)
else
npcHandler:say('You don\'t have enought money to travel!', cid)
self:releaseFocus(cid)
end
end
if msgcontains(msg, 'cormaya') and not isPlayerPzLocked(cid) then
if doPlayerRemoveMoney(cid, 100) == true then
doTeleportThing(cid,{x=33287, y=31955, z=6})
self:releaseFocus(cid)
else
npcHandler:say('You don\'t have enought money to travel!', cid)
self:releaseFocus(cid)
end
end
if msgcontains(msg, 'kazordoon') and not isPlayerPzLocked(cid) then
if doPlayerRemoveMoney(cid, 100) == true then
doTeleportThing(cid,{x=32659, y=31957, z=6})
self:releaseFocus(cid)
else
npcHandler:say('You don\'t have enought money to travel!', cid)
self:releaseFocus(cid)
end
end
if msgcontains(msg, 'ankrahmun') and not isPlayerPzLocked(cid) then
if doPlayerRemoveMoney(cid, 100) == true then
doTeleportThing(cid,{x=33092, y=32883, z=6})
self:releaseFocus(cid)
else
npcHandler:say('You don\'t have enought money to travel!', cid)
self:releaseFocus(cid)
end
end
if msgcontains(msg, 'darashia') and not isPlayerPzLocked(cid) then
if doPlayerRemoveMoney(cid, 100) == true then
doTeleportThing(cid,{x=33289, y=32481, z=6})
self:releaseFocus(cid)
else
npcHandler:say('You don\'t have enought money to travel!', cid)
self:releaseFocus(cid)
end
end
if msgcontains(msg, 'farmine') and not isPlayerPzLocked(cid) then
if doPlayerRemoveMoney(cid, 100) == true then
doTeleportThing(cid,{x=33024, y=31550, z=10})
self:releaseFocus(cid)
else
npcHandler:say('You don\'t have enought money to travel!', cid)
self:releaseFocus(cid)
end
end
if msgcontains(msg, 'goroma') and not isPlayerPzLocked(cid) then
if doPlayerRemoveMoney(cid, 100) == true then
doTeleportThing(cid,{x=32161, y=32558, z=6})
self:releaseFocus(cid)
else
npcHandler:say('You don\'t have enought money to travel!', cid)
self:releaseFocus(cid)
end
end
if isPlayerPzLocked(cid) then
npcHandler:say('You can\'t travel, you have pz!', cid)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to all places: {thais}, {carlin}.'})
npcHandler:addModule(FocusModule:new())