Postado Novembro 3, 2017 7 anos Em 21/04/2016 em 17:29, Carlos Lindo daniel disse: ve se esse serve data/npc/scripts > crie uma pasta.lua renomeie para > vendedorpk dentro voce coloca\/ Mostrar conteúdo oculto local config, buyPoke = { diamondId = 2145, --ID do diamond. pokemons = { ["Shiny Metagross"] = 45, --["nome_do_pokémon"] = preço, ["Shiny Tropius"] = 40, --["nome_do_pokémon"] = preço, ["Shiny Alakazam"] = 40, --["nome_do_pokémon"] = preço, ["Shiny Flygon"] = 35, --["nome_do_pokémon"] = preço, ["Shiny Steelix"] = 40, ["Shiny Tangrowth"] = 40, ["Shiny Milotic"] = 35, ["Shiny Roserade"] = 30, ["Shiny Salamence"] = 30, ["Shiny Dragonite"] = 30, ["Shiny Jynx"] = 25, ["Shiny Vileplume"] = 20, }, }, "" 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("Oi,voce quer comprar pokemon? diga yes", cid) doPlayerPopupFYI(cid, "Selling:\n"..str) talkState[talkUser] = 1 return true elseif msgcontains(msg:lower(), "yes") then if talkState[talkUser] == 1 then selfSay("Qual nome do pokemon que voce quer comprar, com as letras iniciais maiusculas tipo Shiny Bosta.", 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("Voce quer comprar o "..msg.."? Por "..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()) DPS vai em data/npc/ copie um documento XML e renomeie para > vendedorpk e coloque dentro \/ Mostrar conteúdo oculto <?xml version="1.0" encoding="UTF-8"?> <npc name="Shop" script="vendedorpk.lua" walkinterval="3000" floorchange="0" access="5" > <health now="150" max="150"/> <look type="587" head="0" body="114" legs="114" feet="0"/> <parameters> <parameter key="message_greet" value="Bem-vindo, Diga trade veja os poks a venda, dps yes dps nome do pok e yes pronto compro "/> <parameter key="message_farewell" value="Ate a proxima."/> </parameters> </npc> O meu da um erro o meu ta dando erro
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.