Postado Maio 2, 2015 10 anos Autor UP FusionPoké Estará aberto este mês para testes ! Curta A Page e Fique Por Dentro Das Novidades Do Servidor! Like Aqui!
Postado Maio 2, 2015 10 anos Desculpe, esqueci do seu pedido. Logo escreverei o código e enviarei aqui. não respondo pms solicitando suporte em programação/scripting
Postado Maio 2, 2015 10 anos Autor Oks ! Eu só não coloco pelo otc pq quero que só premium account tenha acesso a esse npc Então colocarei ele na area VIP ! Se puder atender ao meu outro pedido, o do sistema de comprar casas meus REP+ de hj serão todos seus ! Editado Maio 2, 2015 10 anos por J.L (veja o histórico de edições) FusionPoké Estará aberto este mês para testes ! Curta A Page e Fique Por Dentro Das Novidades Do Servidor! Like Aqui!
Postado Maio 3, 2015 10 anos local config, buyPoke = { diamondId = xxx, --ID do diamond. pokemons = { ["pokemon_name"] = price, --["nome_do_pokémon"] = preço, ["pokemon_name"] = price, --["nome_do_pokémon"] = preço, ["pokemon_name"] = price, --["nome_do_pokémon"] = preço, }, }, "" 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 if msgcontains(msg:lower(), "buy") or msgcontains(msg:lower(), "trade") then local str = "" for poke, price in pairs(config.pokemons) do if str == "" then str = poke.." - "..price.." diamonds" else str = str.."\n"..poke.." - "..price.." diamonds" end end selfSay("Hello, I sell this pokemons. Wanna buy any of them?", cid) doPlayerPopupFYI(cid, "Selling:\n"..str) talkState[talkUser] = 1 return true elseif msgcontains(msg:lower(), "yes") then if talkState[talkUser] == 1 then selfSay("Tell me the name, please.", cid) talkState[talkUser] = 2 return true elseif talkState[talkUser] == 3 then if buyPoke ~= "" then local price = config.pokemons[buyPoke] if doPlayerRemoveItem(cid, config.diamondId, price) then selfSay("Here's your "..buyPoke.."!", cid) addPokeToPlayer(cid, buyPoke, 0, 1, "normal", true) talkState[talkUser] = 0 return true else selfSay("You do not have "..price.." diamonds.", cid) talkState[talkUser] = 0 return true end end end elseif config.pokemons[msg] and talkState[talkUser] == 2 then selfSay("You really wanna buy a "..msg.."? It will cost you "..config.pokemons[msg].." diamonds.", cid) buyPoke = msg talkState[talkUser] = 3 return true elseif msgcontains(msg:lower(), "no") then selfSay("Then bye.", cid) talkState[talkUser] = 0 return true end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Editado Maio 3, 2015 10 anos por zipter98 (veja o histórico de edições) não respondo pms solicitando suporte em programação/scripting
Postado Maio 3, 2015 10 anos Autor Cara quando eu vo spawnar o npc da esse erro aki FusionPoké Estará aberto este mês para testes ! Curta A Page e Fique Por Dentro Das Novidades Do Servidor! Like Aqui!
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.