Postado Setembro 30, 2016 8 anos gostaria de um npc que troca por exemplo 50 brown piece of cloth + 200 gold por uma JACKET
Postado Outubro 1, 2016 8 anos 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 npcHandler:setMessage(MESSAGE_GREET, "Oi |PLAYERNAME|. Eu posso {trocar} item.") 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, "troca") then selfSay("Troco 50 brown piece of cloth e 200 gold por uma jacket, aceita?", cid) talkState[talkUser] = 1 elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then if getPlayerItemCount(cid, 5913) >= 50 and getPlayerMoney(cid) >= 200 then doPlayerRemoveItem(cid, 5913, 50) -- brown piece of cloth doPlayerRemoveMoney(cid, 200) doPlayerAddItem(cid, 2650) -- jacket else selfSay("Volte quando tiver os itens.", cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
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.