Tenshinkhan
New Member
- Joined
- Nov 9, 2009
- Messages
- 4
- Reaction score
- 1
Hey,
Ihave problem with NPC. After he gets an item from player he don't teleport him. There is no errors in engine. I'm using TFS 0.3.5 tibia 8.5
Else. How to make him to write in "npc channel" because he write only messages like "17:38 Klawisz: Welcome, Lol! I have been expecting you.". Not this what i made in script.
Waiting for help ;D
Ihave problem with NPC. After he gets an item from player he don't teleport him. There is no errors in engine. I'm using TFS 0.3.5 tibia 8.5
Code:
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
if msgcontains(msg, 'help') then
selfSay('Mozesz z tad wyjsc jesli masz kupon na wyjscie')
elseif msgcontains(msg, 'kupon') then
if getPlayerItemCount(cid,5809) >= 1 then
selfSay('Czy przynisoles mi kupon?')
talk_state = 1
else
selfSay('Potrzebuje kuponu by pozwolic Ci z tad szybciej wyjsc. Wroc jak bedziesz mial kupon')
talk_state = 0
end
elseif msgcontains(msg, 'tak') and talk_state == 1 then
talk_state = 0
if getPlayerItemCount(cid,5809) >= 1 then
if
doPlayerRemoveItem(cid,5809, 1) == 1 then
doTeleportThing(cid,{x=999, y=1001, z=7})
doSendMagicEffect(pos, 37)
selfSay('Czekam na ponowne spotkanie.')
else
return 0
end
return 1
end
elseif msgcontains(msg, 'nie') and talk_state == 1 then
selfSay('Jak uwazasz. Milego siedzenia.')
talk_state = 0
end
return 1
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Else. How to make him to write in "npc channel" because he write only messages like "17:38 Klawisz: Welcome, Lol! I have been expecting you.". Not this what i made in script.
Waiting for help ;D