?egnanie si? z npc

Status
Zamknięty.

dominikms1

Senior User
Zarejestrowany
Dołączył
Luty 6, 2010
Posty
696
Liczba reakcji
65
Mam taki kod.
Jak do tego doda? kod, kt?ry b?dzie ?egna? si? z npc'kiem gdy odejdziemy od niego na np. 4 sqm, nie m?wi?c "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
 
Odp: ?egnanie si? z npc

wejdz w twojego npc.xml i dodaj
<interaction range="3" idletime="30">
<interact event="onPlayerLeave" focus="0">
<response text="Goodbye!"/>
</interact>
</interaction>

Powinno dzialac
 
Status
Zamknięty.
Back
Do góry