Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local keywordHandler = KeywordHandler:new()
- local npcHandler = NpcHandler:new(keywordHandler)
- local outfitt = 6575
- local iteem = 2160
- local quatidade = 1
- 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 itemid = 22222222
- local count = 1
- local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT
- if(msgcontains(msg, 'outfit')) then
- selfSay('MSG1') -- Edite Sua Menssagem para quando o player falar *OUTFIT*
- talkState[talkUser] = 1
- elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
- if (getPlayerStorageValue(cid,outfitt) > 0) then
- selfSay('MSG2') -- Eite a menssagem , que se o player tentar trocar de novo , o NPC avisar que ele já fez essa missao
- else
- if getPlayerItemCount(cid, itemid) >= 1 then
- setPlayerStorageValue(cid,outfitt,1)
- doPlayerRemoveItem(cid, itemid,count)
- selfSay('MSG3') -- Edite a menssagem de agradescimento
- else
- selfSay('MSG4') -- Edite a menssagem que o player nao tem x item
- end
- end
- return true
- end
- end
- npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
- npcHandler:addModule(FocusModule:new())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement