Mateus Robeerto
Excellent OT User
can someone put storage on it please.
Lua:
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
if(msgcontains(msg, 'item') or msgcontains(msg, 'item2')) then
selfSay('want to exchange item for another item', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if(getPlayerItemCount(cid, 13685) >= 20) then
doPlayerRemoveItem(cid, 13685, 20)
doPlayerAddItem(cid, 6527, 100)
selfSay('Thank you and come back often.', cid)
else
selfSay('You dont have item.', cid)
end
talkState[talkUser] = 0
-------------------------------------------------------------------------------------------------------------------------------------------------
elseif(msgcontains(msg, 'offer') or msgcontains(msg, 'trade') or msgcontains(msg, 'ofertas')) then
selfSay('teste teste teste.', cid)
selfSay('heloo heloo.',cid)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Last edited: