Ir para conteúdo

Featured Replies

Postado

.Olá pessoal boa noite,

 

Alguém poderia me ajudar a fazer uma alteração no meu script de trainers offline.

 

Gostaria que acrescentasse neste script somente x vocação pode clicar em determinada estatua para treinar offline. Sendo assim o jogador precisa encontrar sua estatua da sua vocação.

 

Mostrar conteúdo oculto

Agradeço deste já muito obrigado!

Utilizo TFS 0.4 - 8.6

 

VENHAM JOGAR O MELHOR BAIAK JÁ CRIADO DE 2022!!

 

CRIE SUA CONTA AGORA MESMO!

 

www.baiakudo.com

Resolvido por Ramon Bernardo

Ir para solução
  • Respostas 5
  • Visualizações 455
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • MatteusDeli
    MatteusDeli

    @DeathRocks Tenta agora   local storage = 62669 local message = "Voce nao pode treinar essa skill, escolha a estatua de sua vocacao." local config = { [1444] = { -- ID statue vocations

  • Ramon Bernardo
    Ramon Bernardo

    A mensagem é enviada várias vezes pois o laço é quebrado apenas quando o jogador é removido, basta mover o break para fora do próximo end.   Ou então tente: local storage = 62669 local m

Postado

@DeathRocks Boa noite, tenta assim:

 

local storage = 62669
local message = "Voce nao pode treinar essa skill, escolha a estatua de sua vocacao."

local config = {
  [1444] = { -- ID statue
    vocations = {4, 8}, -- Knight and Elite Knight
    skill = SKILL_SWORD
  },
  [8836] = {
    vocations = {4, 8}, --  Knight, Elite Knight
    skill = SKILL_AXE
  },
  [8834] = {
    vocations = {1, 2, 5, 6}, -- Sorcerer, Druid, Master Sorcerer, Elder Druid
    skill = SKILL__MAGLEVEL
  },
  [8626] = {
    vocations = {4, 8}, --  Knight, Elite Knight
    skill = SKILL_CLUB
  },
  [10353] = {
    vocations = {3, 7}, --  Paladin, Royal Paladin
    skill = SKILL_DISTANCE
  },
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

    for i = 1, #config[item.itemid].vocations, 1 do
      local vocation = config[item.itemid].vocations[i]
      local skill = config[item.itemid].skill
      if (getPlayerVocation(cid) == vocation) then
        doCreatureSetStorage(cid, storage, skill)
        break
      else
        doPlayerSendCancel(cid, message)
      end
    end
  
  if item.actionid == 6341 then
    doRemoveCreature(cid)
  end

  return true
end

 

Postado
  • Autor
  Em 09/04/2022 em 02:37, MatteusDeli disse:

@DeathRocks Boa noite, tenta assim:

 


local storage = 62669
local message = "Voce nao pode treinar essa skill, escolha a estatua de sua vocacao."

local config = {
  [1444] = { -- ID statue
    vocations = {4, 8}, -- Knight and Elite Knight
    skill = SKILL_SWORD
  },
  [8836] = {
    vocations = {4, 8}, --  Knight, Elite Knight
    skill = SKILL_AXE
  },
  [8834] = {
    vocations = {1, 2, 5, 6}, -- Sorcerer, Druid, Master Sorcerer, Elder Druid
    skill = SKILL__MAGLEVEL
  },
  [8626] = {
    vocations = {4, 8}, --  Knight, Elite Knight
    skill = SKILL_CLUB
  },
  [10353] = {
    vocations = {3, 7}, --  Paladin, Royal Paladin
    skill = SKILL_DISTANCE
  },
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

    for i = 1, #config[item.itemid].vocations, 1 do
      local vocation = config[item.itemid].vocations[i]
      local skill = config[item.itemid].skill
      if (getPlayerVocation(cid) == vocation) then
        doCreatureSetStorage(cid, storage, skill)
        break
      else
        doPlayerSendCancel(cid, message)
      end
    end
  
  if item.actionid == 6341 then
    doRemoveCreature(cid)
  end

  return true
end

 

Olá bom dia, não deu certo.

Continua deslogando em qualquer estátua...

VENHAM JOGAR O MELHOR BAIAK JÁ CRIADO DE 2022!!

 

CRIE SUA CONTA AGORA MESMO!

 

www.baiakudo.com

Postado

@DeathRocks Tenta agora

 

local storage = 62669
local message = "Voce nao pode treinar essa skill, escolha a estatua de sua vocacao."

local config = {
  [1444] = { -- ID statue
    vocations = {4, 8}, -- Knight and Elite Knight
    skill = SKILL_SWORD
  },
  [8836] = {
    vocations = {4, 8}, --  Knight, Elite Knight
    skill = SKILL_AXE
  },
  [8834] = {
    vocations = {1, 2, 5, 6}, -- Sorcerer, Druid, Master Sorcerer, Elder Druid
    skill = SKILL__MAGLEVEL
  },
  [8626] = {
    vocations = {4, 8}, --  Knight, Elite Knight
    skill = SKILL_CLUB
  },
  [10353] = {
    vocations = {3, 7}, --  Paladin, Royal Paladin
    skill = SKILL_DISTANCE
  },
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

    for i = 1, #config[item.itemid].vocations, 1 do
      local vocation = config[item.itemid].vocations[i]
      local skill = config[item.itemid].skill
      if (getPlayerVocation(cid) == vocation and item.actionid == 6341) then
        doCreatureSetStorage(cid, storage, skill)
        doRemoveCreature(cid)
        break
      else
        doPlayerSendCancel(cid, message)
      end
    end

  return true
end

 

Postado
  • Autor
  Em 09/04/2022 em 14:35, MatteusDeli disse:

@DeathRocks Tenta agora

 


local storage = 62669
local message = "Voce nao pode treinar essa skill, escolha a estatua de sua vocacao."

local config = {
  [1444] = { -- ID statue
    vocations = {4, 8}, -- Knight and Elite Knight
    skill = SKILL_SWORD
  },
  [8836] = {
    vocations = {4, 8}, --  Knight, Elite Knight
    skill = SKILL_AXE
  },
  [8834] = {
    vocations = {1, 2, 5, 6}, -- Sorcerer, Druid, Master Sorcerer, Elder Druid
    skill = SKILL__MAGLEVEL
  },
  [8626] = {
    vocations = {4, 8}, --  Knight, Elite Knight
    skill = SKILL_CLUB
  },
  [10353] = {
    vocations = {3, 7}, --  Paladin, Royal Paladin
    skill = SKILL_DISTANCE
  },
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

    for i = 1, #config[item.itemid].vocations, 1 do
      local vocation = config[item.itemid].vocations[i]
      local skill = config[item.itemid].skill
      if (getPlayerVocation(cid) == vocation and item.actionid == 6341) then
        doCreatureSetStorage(cid, storage, skill)
        doRemoveCreature(cid)
        break
      else
        doPlayerSendCancel(cid, message)
      end
    end

  return true
end

 

Agora de certo, porem ele tá repetindo 3x a função 

doPlayerSendCancel(cid, message)

Ao clicar na estatua. Em vez de avisar apenas uma vez ao clicar...

VENHAM JOGAR O MELHOR BAIAK JÁ CRIADO DE 2022!!

 

CRIE SUA CONTA AGORA MESMO!

 

www.baiakudo.com

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