Boa noite a todos,
Essa duvida acredito ser bem simples!
criei um npc de troca no meu server e ele da o pokemon de troca como unike item, tem como ser normal?
Script do npc:
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 msg = string.lower(msg) local need = { --item id....quantidade {id = 12581, qt = 1}, {id = 11445, qt = 20}, } local storage = 83498 local pokemon = "Aerodactyl" -- // -- if msgcontains(string.lower(msg), 'help') or msgcontains(string.lower(msg), 'help') then if getPlayerStorageValue(cid, storage) == 1 then selfSay("você já completou minha quest!", cid) talkState[talkUser] = 0 return true end selfSay("olá, você gostaría de trocar {1 Old Amber e 20 Rock Stone} por Aerodactyl, {Yes} ou {No}?", cid) talkState[talkUser] = 2 return true elseif msgcontains(msg, 'yes') and talkState[talkUser] == 2 then for i = 1, #need do if getPlayerItemCount(cid, need[i].id) <need[i].qt then selfSay("você não tem todos os itens necessaríos, volte aqui quando tive-los!", cid) talkState[talkUser] = 0 return true end end if not addPokeToPlayer(cid, pokemon, 0, -1, "normal", true) then selfSay("você esta com 6 pokemons na sua bag, volte aqui contendo espaço para o seu novo pokemon!", cid) talkState[talkUser] = 0 return true end for i = 1, #need do doPlayerRemoveItem(cid, need[i].id, need[i].qt) end selfSay("Parabéns, faça um bom proveito do seu novo pokémon!", cid) setPlayerStorageValue(cid, storage, 1) talkState[talkUser] = 0 return true end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())