Ir para conteúdo

Featured Replies

Postado

@Navegante 

local skills = {
    
    [0] = {"FIST UP", TEXTCOLOR_LIGHTBLUE, 21},
    [1] = {"CLUB UP", TEXTCOLOR_LIGHTBLUE, 21}, -- [SKILL_ID] = {"ANIMATED TEXT", TYPE do animated, effect no player}
    [2] = {"SWORD UP", TEXTCOLOR_LIGHTBLUE, 21},
    [3] = {"AXE UP", TEXTCOLOR_LIGHTBLUE, 21},
    [4] = {"DISTANCE UP", TEXTCOLOR_LIGHTBLUE, 21},
    [5] = {"SHIELD UP", TEXTCOLOR_LIGHTBLUE, 21},
    [6] = {"FISHING UP", TEXTCOLOR_LIGHTBLUE, 21},
    [7] = {"ML UP", TEXTCOLOR_LIGHTBLUE, 21},
    [8] = {"LEVEL UP", TEXTCOLOR_LIGHTBLUE, 21},
    
}

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

function onAdvance(player, skill, oldLevel, newLevel)
    
    if newLevel <= oldLevel then
        return true
    end
    
    if config.effect then
        local up = skills[skill]
        if up then 	
            player:getPosition():sendMagicEffect(up[3])
            game:sendAnimatedText(player:getPosition(), up[1], up[2])
        end
    end
    
    if config.heal then
        player:addHealth(player:getMaxHealth())
    end
    
    if config.save then
        player:save()
    end
    return true
end

 

  • Respostas 8
  • Visualizações 358
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Opa rapaz beleza? Acabei de montar aqui pra você mas eu não sei qual o nome do parâmetro de mensagem amarela   Então resolvi fazer só com as skills ok? local config = { msg_levelup_level = tr

  • fala aê mano tudo tranquilo? Eu fiz o teste e aproveitei para completar as outras skills seguindo o formato que você fez.   O único problema é que qualquer skills que eu upar aparece a

  • Essa parte do player:say não é problema, só não sei qual é o parâmetro de texto que deixa na coloração amarela ! Atualizado o script la em cima, testa.

Posted Images

Postado
  • Autor
14 minutos atrás, Sttorm disse:

@Navegante 


local skills = {
    
    [0] = {"FIST UP", TEXTCOLOR_LIGHTBLUE, 21},
    [1] = {"CLUB UP", TEXTCOLOR_LIGHTBLUE, 21}, -- [SKILL_ID] = {"ANIMATED TEXT", TYPE do animated, effect no player}
    [2] = {"SWORD UP", TEXTCOLOR_LIGHTBLUE, 21},
    [3] = {"AXE UP", TEXTCOLOR_LIGHTBLUE, 21},
    [4] = {"DISTANCE UP", TEXTCOLOR_LIGHTBLUE, 21},
    [5] = {"SHIELD UP", TEXTCOLOR_LIGHTBLUE, 21},
    [6] = {"FISHING UP", TEXTCOLOR_LIGHTBLUE, 21},
    [7] = {"ML UP", TEXTCOLOR_LIGHTBLUE, 21},
    [8] = {"LEVEL UP", TEXTCOLOR_LIGHTBLUE, 21},
    
}

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

function onAdvance(player, skill, oldLevel, newLevel)
    
    if newLevel <= oldLevel then
        return true
    end
    
    if config.effect then
        local up = skills[skill]
        if up then 	
            player:getPosition():sendMagicEffect(up[3])
            game:sendAnimatedText(player:getPosition(), up[1], up[2])
        end
    end
    
    if config.heal then
        player:addHealth(player:getMaxHealth())
    end
    
    if config.save then
        player:save()
    end
    return true
end

 

Olá Sttorm! Eu testei o script e deu o seguinte erro

alias se possível teria como você fazer um pequeno ajuste? É que eu gostaria que a função >>>> player:addHealth(player:getMaxHealth()) <<<<< funcionasse somente quando o player subisse de  level. 

erro na distro.PNG

Postado

@Navegante 

local skills = {
    
    [0] = {"FIST UP", TEXTCOLOR_LIGHTBLUE, 21},
    [1] = {"CLUB UP", TEXTCOLOR_LIGHTBLUE, 21}, -- [SKILL_ID] = {"ANIMATED TEXT", TYPE do animated, effect no player}
    [2] = {"SWORD UP", TEXTCOLOR_LIGHTBLUE, 21},
    [3] = {"AXE UP", TEXTCOLOR_LIGHTBLUE, 21},
    [4] = {"DISTANCE UP", TEXTCOLOR_LIGHTBLUE, 21},
    [5] = {"SHIELD UP", TEXTCOLOR_LIGHTBLUE, 21},
    [6] = {"FISHING UP", TEXTCOLOR_LIGHTBLUE, 21},
    [7] = {"ML UP", TEXTCOLOR_LIGHTBLUE, 21},
    [8] = {"LEVEL UP", TEXTCOLOR_LIGHTBLUE, 21},
    
}

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

function onAdvance(player, skill, oldLevel, newLevel)
    
    if newLevel <= oldLevel then
        return true
    end
    
    if config.effect then
        local up = skills[skill]
        if up then 	
            player:getPosition():sendMagicEffect(up[3])
            doSendAnimatedText(player:getPosition(), up[1], up[2])
        end
    end
    
    if config.heal and skill == 8 then
        player:addHealth(player:getMaxHealth())
    end
    
    if config.save then
        player:save()
    end
    return true
end

 

Postado
  • Autor
  • Solução

Script atualizado:

local skills = {

    [0] = {"Fist up!", 29},
    [1] = {"Club up!", 29}, -- [SKILL_ID] = {"ANIMATED TEXT", effect no player}
    [2] = {"Sword up!", 29},
    [3] = {"Axe up!", 29},
    [4] = {"Dist up!", 29},
    [5] = {"Shield up!", 29},
    [6] = {"Fish up!", 29},
    [7] = {"Magic up!", 31},
    [8] = {"Level up!", 30},

}

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

function onAdvance(player, skill, oldLevel, newLevel)

    if newLevel <= oldLevel then
        return true
    end

    if config.effect then
        local up = skills[skill]
        if up then
            player:say(up[1], TALKTYPE_MONSTER_SAY)
            player:getPosition():sendMagicEffect(up[2])
        end
    end

    if config.heal and skill == 8 then
        player:addHealth(player:getMaxHealth())
    end

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

Crédito: Sttorm
Participação: tataboy 67


muito obrigado pela ajuda de ambos!!!

Editado por Navegante (veja o histórico de edições)

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.7k

Informação Importante

Confirmação de Termo