• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

NPC odpowiada na dwóch kanałach

Verdis

Ciekawy świata.
Joined
May 28, 2012
Messages
394
Reaction score
9
Location
Poland
Witam,
Dlaczego NPC odpowida na dwóch kanałach (default, npc's)?
Proszę o pomoc, liby zmieniałem od npc ale to jest jeszcze gorzej :)
 
PHP:
<npc name="Obi" script="data/npc/scripts/furniture.lua" floorchange="0" access="5" level="1" maglevel="1">
	<health now="150" max="150"/>
	<look type="134" head="115" body="10" legs="90" feet="115" corpse="2212"/>
	<parameters>
    <parameter key="message_greet" value="Witaj |PLAYERNAME|. Pragniesz wyzwania napisz {(event)}." />
  </parameters>
</npc>

PHP:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

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 item = {8614, 40} -- {id, count}
	local pos = {x = 177, y = 46, z = 7} -- pozycja
	
	if(msgcontains(msg, 'event')) then
		if(doPlayerRemoveItem(cid, item[1], item[2])) then
			npcHandler:say('Zostales przeniesiony na event!', cid)
			doTeleportThing(cid, pos)
			doSendMagicEffect(pos, CONST_ME_TELEPORT)
		else
			npcHandler:say("Przykro mi, ale nie moge cie wpuscic na event!", cid)
			end
			
		
	end
	return true
end


npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Patrzałem u siebie i masz tak samo złożony npc jak ja z tych samych funkcji i u mnie działa wina libków ;p
 
Back
Top