kaspertje100
Member
- Joined
- May 8, 2008
- Messages
- 236
- Reaction score
- 7
Hi here is the error:
Lua script error: [Npc internface] data/npc/scripts/aruda.lua
ncreaturesay
data/npc/scripts/aruda.lua:12: attempt to call method 'is focused; (a nil value) stack traceback
data/npc/scripts/aruda.lua:12: in function 'callback'
data/npc/scripts/lib/npcsystem/npchandler.lua:299: in function 'oncreatureSay'
data/npc/scripts/aruda.lua:8: in function (data/npc/scripts/aruda.lua:8
xml code:
rep++ if helped
a new aruda scripts is also rep ++!!
Yours kaspertje100
the code .lua
Lua script error: [Npc internface] data/npc/scripts/aruda.lua
data/npc/scripts/aruda.lua:12: attempt to call method 'is focused; (a nil value) stack traceback
data/npc/scripts/aruda.lua:12: in function 'callback'
data/npc/scripts/lib/npcsystem/npchandler.lua:299: in function 'oncreatureSay'
data/npc/scripts/aruda.lua:8: in function (data/npc/scripts/aruda.lua:8
xml code:
PHP:
<npc name="Lady Victoria" script="aruda.lua" autowalk="25" floorchange="0" access="5" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="142" head="114" body="0" legs="95" feet="114" corpse="2212"/>
<parameters>
<parameter key="module_shop" value="1" />
<parameter key="message_greet" value="Hello |PLAYERNAME|." />
</parameters>
</npc>
rep++ if helped
a new aruda scripts is also rep ++!!
Yours kaspertje100
the code .lua
PHP:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
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
-- OTServ event handling functions end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
if msgcontains(msg, 'gold') then
selfSay('I can steal your gold!".')
elseif msgcontains(msg, 'yes') and talk_state == 1 then
talk_state = 0
if doPlayerRemoveItem(cid,2160, 10) == TRUE then
selfSay('Thank you.')
end
else
selfSay(havent_item)
end
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())