Ir para conteúdo

Featured Replies

Postado

1° troque o createpokeball por esse;

local typess = {       --alterado v2.9 \/  TUDO!!
[1] = "normal",
[2] = "great",
[3] = "super",
[4] = "ultra",
[5] = "saffari",
}
function onSay(cid, words, param)
 
if param == "" or param == " " then
   doPlayerSendCancel(cid, 'Command needs parameters, function structure: "/cb [Pokemon Name], [boost], [Gender], [ball type]".')
   return false
end
 
local t = string.explode(param, ",")
--
local name = ""
local btype = (tostring(t[4]) and pokeballs[t[4]]) and t[4] or typess[math.random(1, #typess)] 
local gender = (t[3] and tonumber(t[3])) and tonumber(t[3]) or t[3] and t[3] or nil              
 
if tostring(t[1]) then
name = doCorrectString(t[1])   
if not pokes[name] then
  doPlayerSendCancel(cid, "Sorry, a pokemon with the name "..name.." doesn't exists.")
  return true
end
print(""..name.." ball has been created by "..getPlayerName(cid)..".")
end
 
addPokeToPlayer(cid, name, (t[2] and tonumber(t[2]) or 0), gender, btype)
 
return true
end

 

teste e fale se funcionou, vou ajuda de 1 em 1 ^^

  • Respostas 21
  • Visualizações 4.6k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • 1° troque o createpokeball por esse;   teste e fale se funcionou, vou ajuda de 1 em 1

  • Erro Nº 3 = Os pokemons selvagens estao usando Movementos (ataques) que nao esta na tabela de movementos.. Entao para concertar, voce tem que verificar quais pokemons estao com ataques que nao tem na

  • 2º - NPC DALK  troque o script por esse;   teste e fale se funcionou

Postado

2º - NPC DALK 

troque o script por esse;

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 configs = {
diamondsID = 2145,  --id do diamond no items.xml/otb... (achu q vais ter q criar, ou pegar algum item q ja tenha ae...)
VIP = {days = 30, cost = 10},    --days = qnts dias de VIP o player compra por vez.... cost = custo para virar VIP...
SEX = {cost = 2},   --cost = custo para trocar de sexo...
TOWN = {cost = 2},  --cost = custo para trocar de city...
}  
 
local places = {
["saffron"] = 1,    --tens q por o id do RME das tuas citys aki...
["cerulean"] = 2,
["lavender"] = 3,
["fuchsia"] = 4,
["celadon"] = 5, 
["viridian"] = 6, 
["vermilion"] = 7, 
["pewter"] = 8,                      
["cinnabar"] = 10,
}
 
       
        if (msgcontains(msg, 'diamond account') or msgcontains(msg, 'diamond')) then  
           selfSay("você que paga uma diamond account e Ser VIP até "..configs.VIP.days.." dias? Custará "..configs.VIP.cost.." diamonds!", cid)   
           talkState[talkUser] = 2
           return true    
          
        elseif msgcontains(msg, 'yes') and talkState[talkUser] == 2 then
           if getPlayerItemCount(cid, configs.diamondsID) >= configs.VIP.cost then
              selfSay("Ok então, agora você tem "..configs.VIP.days.." dias de VIP, Divirta-se!", cid)
              doPlayerAddPremiumDays(cid, configs.VIP.days)
              doPlayerRemoveItem(cid, configs.diamondsID, configs.VIP.cost)
              talkState[talkUser] = 0
              return true
           else
              selfSay("Você precisa de pelo menos "..configs.VIP.cost.." diamonds para fazer isso!", cid)
              talkState[talkUser] = 0
              return true
           end
           
        elseif (msgcontains(msg, 'sex change') or msgcontains(msg, 'sex')) then
           selfSay("Então você quer mudar de sexo? Custará "..configs.SEX.cost.." diamonds, Para isso Fale sex change ou sex", cid) 
           talkState[talkUser] = 3
           return true
        
        elseif msgcontains(msg, 'yes') and talkState[talkUser] == 3 then
           if getPlayerItemCount(cid, configs.diamondsID) >= configs.SEX.cost then
              local sex = getPlayerSex(cid)
              selfSay("Ok então, agora você é do sexo "..(sex == 0 and "female" or "male")..". Divirta-se!", cid)
              doPlayerSetSex(cid, (sex == 0 and 1 or 0))
              doPlayerRemoveItem(cid, configs.diamondsID, configs.SEX.cost)
              talkState[talkUser] = 0
              return true
           else
              selfSay("Você precisa de pelo menos "..configs.SEX.cost.." diamonds para fazer isso!", cid)
              talkState[talkUser] = 0
              return true
           end
           
        elseif (msgcontains(msg, 'town change') or msgcontains(msg, 'town')) then 
           selfSay("Então você quer mudar sua cidade natal? Custará "..configs.TOWN.cost.." diamonds, para isso fale town change ou town", cid) 
           talkState[talkUser] = 4
           return true
           
        elseif msgcontains(msg, 'yes') and talkState[talkUser] == 4 then
           selfSay("Ok, então, me diga qual cidade?", cid)
           talkState[talkUser] = 5
           return true
           
        elseif places[msg] and talkState[talkUser] == 5 then
           if getPlayerItemCount(cid, configs.diamondsID) >= configs.TOWN.cost then
              selfSay("Feito, desfrutar da sua nova cidade!", cid)
              doPlayerSetTown(cid, places[msg]) 
              doPlayerRemoveItem(cid, configs.diamondsID, configs.TOWN.cost)
              talkState[talkUser] = 0
              return true
           else
              selfSay("Você precisa de pelo menos "..configs.TOWN.cost.." diamonds para fazer isso!", cid)
              talkState[talkUser] = 0
              return true
           end 
           
        elseif msgcontains(msg, 'no') then
          selfSay("Ok, então, dizer-me outra vez o que você quer ...", cid)
          talkState[talkUser] = 0
          return true 
        end
 
return true
end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())             

 

teste e fale se funcionou

Postado

ERRO 2: Sobre o NPC:

A função da linha 68 "places" provavelmente não existe na lib, sendo usada incorretamente ou está conflitando.

 

Não conheço direito as funções destes servidores derivados.

Conforme for conseguindo tempo, vou verificando os erros pra você.

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo