Dominik ms
Member
- Joined
- Jan 20, 2010
- Messages
- 424
- Reaction score
- 6
I have this code.
And i want to disappear with npc when player leave, go with distance ex.4 sqm, without say "bye"??
And i want to disappear with npc when player leave, go with distance ex.4 sqm, without say "bye"??
PHP:
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) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
local talkState = {}
function onCreatureSay(cid, type, msg)
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if (msg == "hi") then
selfSay("Welcome, ".. getCreatureName(cid) ..".", cid, true)
talkState[talkUser] = 1
end
end