As the title says. When i say msgcontain(msg,"cyko sucks"), it goes back to msgcontain(msg,"cyko")!
LUA:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local Topic = {}
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 greetCallback(cid)
Topic[cid] = 0
return true
end
function creatureSayCallback(cid, type, msg)
if not npcHandler:isFocused(cid) then
return false
end
if msgcontains(msg, 'cyko') then
if getPlayerStorageValue(cid, storage) == -1 and getPlayerStorageValue(cid,90000) == 2 then
npcHandler:say("I remeber that kid, he couldn't even fix a npc.",cid)
Topic[cid] = 1
end
elseif Topic[cid] == 1 then
if (msgcontains(msg, 'cyko sucks')) then
npcHandler:say("Im pretty sure that i know he sucks.", cid)
end
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Last edited: