I
Icy
Guest
LUA:
local sexMessage = ''
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)
if getPlayerSex(cid) == 0 then
sexMessage = 'You are a girl'
else
sexMessage = 'You are a guy'
end
npcHandler:onCreatureSay(cid, type, msg)
end
function onThink() npcHandler:onThink() end
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
keywordHandler:addKeyword({'guide'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Try saying {sex}'})
keywordHandler:addKeyword({'sex'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = sexMessage})
npcHandler:addModule(FocusModule:new())
When I say `sex` to him he replies with nothing:
Anyone know what's wrong with this?19:52 Icy [5]: sex
19:52 Aidan:
Last edited by a moderator: