Using the Marina npc so i can get some silk yarns, she only takes my giant spider silk and gives nothing back in return. what might be wrong? Had doPlayerAddItem before, didn't work either :S
Code:
local talk_state = 0
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
function creatureSayCallback(cid, type, msg)
if msgcontains(msg, 'silk yarn') then
if getPlayerItemCount(cid,5879) >= 10 then
if doPlayerRemoveItem(cid,5879,10) == 1 then
selfSay('Ew... gooey... there you go. .')
PlayerAddItem(cid,5886,1)
end
else
selfSay('Ew... gooey... you dont have required items. ')
talk_state = 0
end
elseif msgcontains(msg, 'no') then
selfSay('Ok.. Good bye then!!')
talk_state = 0
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())