With the new NPC system of TFS Im not able to make a NPC that changes a certain amount of items for a new item:
Thanks
Code:
elseif msgcontains(msg, 'yes') and talk_state == 1 then
if getPlayerItemCount(cid,2487) >= 1 then
if doPlayerTakeItem(cid,2487,1) == 0 then
selfSay('Here you are.')
doPlayerAddItem(cid,5887,1)
end
else
selfSay(hasNoMsg)
end
talk_state = 0[/php]
Someone could make one with the new system with this one:
[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
npcHandler:addModule(FocusModule:new())
Thanks
Last edited by a moderator: