Tprocheira
New Member
- Joined
- Apr 2, 2008
- Messages
- 103
- Reaction score
- 0
How can I use talkState[talkUser] at TFS?
I've trying to make an NPC, and when I say hi, it answers NOTHING.
Should I use onCreatureSay or creatureSayCallBack?
And, am I using it correctly?
Please, answer
Tprocheira
I've trying to make an NPC, and when I say hi, it answers NOTHING.
Code:
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 talker = getCreaturePosition(cid)
local status = getPlayerStorageValue(cid, 10000)
if((msg == "hi" or msg == "hello") and (status == 0)) then
selfSay("Who... Who are you, ".. getCreatureName(cid) .."?", cid, TRUE)
selfSay("Are you hunting me or what!?", cid)
addFocus(cid)
talkState[talkUser] = 1
--Quest - Part 1
elseif((msg == "no") and (talkState[talkUser] == 1) and (status == 0)) then
selfSay("Ok then... But, what brings such a person here?", cid)
talkState[talkUser] = 2
end
end
And, am I using it correctly?
Please, answer
Tprocheira