Claro, você cometeu alguns erros básicos.
Primeiro, você atribui a variável level, o level atual do jogador, depois verifica se tal é maior ou igual a 8 e manda a mensagem. Mesmo que o jogador continue no 8 e evolua, por exemplo, Sword Fighting, a mensagem seria mandada.
O mais correto a fazer seria se utilizar dos parâmetros que a função fornece para você.
local vocations = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}
function onAdvance(cid, skill, oldLevel, newLevel)
if skill == SKILL__LEVEL then
if newLevel >= 8 then
if isInArray(vocations, getPlayerVocation(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você recebeu cinco stat points. Para checar seus pontos, digite !points")
end
end
end
return true
end



info
Grupo: Artesão
Registrado: 08/10/12
Posts: 114
Reputação: 0
Eu queria que fosse enviada uma mensagem quando o jogador evoluisse de nível, ai montei esse script. Só que o problema é que toda vez que o player mata um monstro e recebe exp, a mensagem é enviada. Eu quero que ela seja enviada apenas quando o jogador evoluir, e se tiver vocação.
function onAdvance(cid, skill, oldLevel, newLevel) level = getPlayerLevel(cid) vocs = {1,2,3,4,5,6,7,8,9,10,11,12} if isInArray(vocs, getPlayerVocation(cid)) then if level >= 8 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você recebeu 5 Stats Points! Para checar seus pontos use !Points.") end return TRUE end end