@DdJs, eu coloquei sobre um npc, por ex, o npc Guide Luke e ja reiniciei o server, porem quando falo com ele, nao da a opcao de trade, de falar nada.
O lua do Npc ficou assim, ve se ficou correto.
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 config = {
itemNeeded = 2160,
count = 5,
addonName = "Assassin",
outfitId = 310,
giveAddons = 2,
storage = 3847,
}
if (msgcontains(msg, config.addonName)) then
if doPlayerRemoveItem(cid, config.itemNeeded, config.count) then else selfSay('Sorry, you need a '..config.count..' of '..getItemNameById(config.itemNeeded)..' for complet a my trade.', cid) end
if getPlayerStorageValue(cid, config.storage) < 1 then else return selfSay('Sorry, you this have a addon of '..config.addonName..' Outfit.', cid) end
selfSay("Well I give you "..config.addonName..", the more you need to give me certain items do you accept this trade? ", cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, "yes")) and talkState[talkUser] == 1 then
selfSay("Thank you, you can look at your inventory of outfits.",cid)
talkState[talkUser] = 0
doPlayerAddOutfit(cid,config.outfitId, config.giveAddons)
setPlayerStorageValue(cid, config.storage, 1)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())