Witam mam do was prośbę jak zrobić żeby ten npc odpisywał tylko płci Male (męskiej). Na pewno jest to kwestia jednej linijki ale nie wiem jakiej ;/ będę bardzo wdzięczny a oto ten Skrypt.
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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 creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
local storage = getPlayerStorageValue(cid, 23112)
if msgcontains(msg, 'outfit') then
if storage == -1 then
npcHandler:say("My scimitar? Yes, that is a true masterpiece. Of course I could make one for you, but I have a small request. Would you fulfil a task for me?", cid)
Topic[talkUser] = 1
else
npcHandler:say("Sorry invalid sex, go Ishina", cid)
end
elseif msgcontains(msg, 'yes') and Topic[talkUser] == 1 then
npcHandler:say("Listen, um... I know that Ishina has been wanting a comb for a long time... not just any comb, but a mermaid's comb. She said it prevents split ends... or something. ...", cid)
npcHandler:say("Do you think you could get one for me so I can give it to her? I really would appreciate it.", cid)
Topic[talkUser] = 2
elseif msgcontains(msg, 'yes') and Topic[talkUser] == 2 then
npcHandler:say("Brilliant! I will wait for you to return with a mermaid's comb then.", cid)
Topic[talkUser] = 0
setPlayerStorageValue(cid, 23112, 1)
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())