Ir para conteúdo

Featured Replies

Postado

Olá galera do TibiaKing, preciso de ajuda com o arquivo "advance_save.lua", pois quando eu upo de nível cura toda a vida e mana e eu queria que não curasse.

 

script:



local config = {
    heal = false,
    save = true,
    effect = false
}

function onAdvance(cid, skill, oldLevel, newLevel)
    if skill ~= 8 or newLevel <= oldLevel then
        return true
    end

    local player = Player(cid)
    if config.effect then
        player:getPosition():sendMagicEffect(math.random(CONST_ME_FIREWORK_YELLOW, CONST_ME_FIREWORK_BLUE))
        player:say('Level Up!', TALKTYPE_MONSTER_SAY)
    end
    
    if config.heal then
        player:addHealth(player:getMaxHealth())
    end


    if config.save then
        player:save()
    end
    return true
end

 

Obs: TFS 1.0

  • Respostas 5
  • Visualizações 368
  • Created
  • Última resposta

Top Posters In This Topic

Postado

Caso queira voltar a healar, volte com a script antiga, eu deletei a parte de healar o player.

 

 

Spoiler

local config = {
    save = true,
    effect = false
}

function onAdvance(cid, skill, oldLevel, newLevel)
    if skill ~= 8 or newLevel <= oldLevel then
        return true
    end

    local player = Player(cid)
    if config.effect then
        player:getPosition():sendMagicEffect(math.random(CONST_ME_FIREWORK_YELLOW, CONST_ME_FIREWORK_BLUE))
        player:say('Level Up!', TALKTYPE_MONSTER_SAY)
    end
   
    if config.save then
        player:save()
    end
    return true
end

 

Postado
  • Autor
4 horas atrás, Pepeco disse:

Caso queira voltar a healar, volte com a script antiga, eu deletei a parte de healar o player.

 

 

  Ocultar conteúdo

local config = {
    save = true,
    effect = false
}

function onAdvance(cid, skill, oldLevel, newLevel)
    if skill ~= 8 or newLevel <= oldLevel then
        return true
    end

    local player = Player(cid)
    if config.effect then
        player:getPosition():sendMagicEffect(math.random(CONST_ME_FIREWORK_YELLOW, CONST_ME_FIREWORK_BLUE))
        player:say('Level Up!', TALKTYPE_MONSTER_SAY)
    end
   
    if config.save then
        player:save()
    end
    return true
end

 

Obrigado por comentar, mas ainda continuo com o problema, amigo.

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