Postado Janeiro 8, 2018 7 anos Em 03/05/2012 em 18:02, Vodkart disse: 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 price = 2000 local msg= string.lower(msg) if msgcontains(msg, 'black anbu') then outID,storage,name,check = 47,78410,msg,true elseif msgcontains(msg, 'white anbu') then outID,storage,name,check = 50,78411,msg,true end if check == true then npcHandler:say('você quer comprar a outfit '..name..' por '..price..' gps? {yes}', cid) talkState[talkUser] = 1 check = false end if msgcontains(msg, 'yes') and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, storage) == -1 then if doPlayerRemoveMoney(cid, price) then doPlayerAddOutfit(cid, outID, 1) setPlayerStorageValue(cid, storage, 1) npcHandler:say('aqui está sua outfit!', cid) talkState[talkUser] = 0 else npcHandler:say('você precisa de '..price..' gps para comprar.', cid) talkState[talkUser] = 0 end else npcHandler:say('você já tem está outfit.', cid) talkState[talkUser] = 0 end elseif msg == "no" then selfSay("Tudo bem então", cid) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) -edited tinha colocado a função errado, tava dando addon de vez de outfit kk arrumada ja ola amigo eu digo nome ele fala que comprei mais nao consta no meu char
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.