Ecstacy
Mothafuckaaa
Hey,
I'm having a problem with the NPC system of TFS.
No custom made npc responds :s.
Npc file:
Npc dummy script:
I'm having a problem with the NPC system of TFS.
No custom made npc responds :s.
Npc file:
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Private" script="privacc.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="134" head="78" body="88" legs="0" feet="88" addons="3"/>
</npc>
Npc dummy script:
Lua:
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-------------------------------------------------------
---------------------------------------------------------------------------------------------
local topic,name,pass = {},{},{}
function creatureSayCallback(cid, type, msg)
if msgcontains(msg:lower(),'hi')
if getPlayerLevel(cid) < 200 then
npcHandler:say('hello',cid)
topic[cid] = 1
else
npcHandler:say('kanker',cid)
end
elseif topic[cid] == 1 then
if msgcontains(msg:lower(),'kanker') then
npcHandler:say('ok mon, ganja is die shit',cid)
topic[cid] = 0
else
npcHandler:say('ganja',cid)
topic[cid] = 0
end
end
return true
end