Ir para conteúdo

Featured Replies

Resolvido por zipter98

Ir para solução
Postado
  • Solução

Tags:

<event type="logout" name="skullLogin" event="script" value="nome_do_arquivo.lua"/> 
<event type="statschange" name="skullStatsChange" event="script" value="nome_do_arquivo.lua"/>
<event type="target" name="skullTarget" event="script" value="nome_do_arquivo.lua"/>
Código (data/creaturescripts/scripts):
local monsterName = "nome_do_monstro"
 
function onStatsChange(cid, attacker, type, combat, value)
    if isPlayer(attacker) and getCreatureSkullType(attacker) ~= SKULL_WHITE and isMonster(cid) and getCreatureName(cid) == monsterName and type == STATSCHANGE_HEALTHLOSS then
        doCreatureSetSkullType(attacker, SKULL_WHITE)
    end
    return true
end
function onTarget(cid, target)
    if isPlayer(cid) and getCreatureSkullType(cid) ~= SKULL_WHITE and isMonster(target) and getCreatureName(target) == monsterName then
        doCreatureSetSkullType(cid, SKULL_WHITE)
    end
    return true
end
function onLogin(cid)
    registerCreatureEvent(cid, "skullStatsChange")
    registerCreatureEvent(cid, "skullTarget")
    return true
end

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

não respondo pms solicitando suporte em programação/scripting

Postado
  • Autor

 

Tags:

<event type="logout" name="skullLogin" event="script" value="nome_do_arquivo.lua"/> 
<event type="statschange" name="skullStatsChange" event="script" value="nome_do_arquivo.lua"/>
<event type="target" name="skullTarget" event="script" value="nome_do_arquivo.lua"/>
Código (data/creaturescripts/scripts):
local monsterName = "nome_do_monstro"
 
function onStatsChange(cid, attacker, type, combat, value)
    if isPlayer(attacker) and getCreatureSkullType(attacker) ~= SKULL_WHITE and isMonster(cid) and getCreatureName(cid) == monsterName and type == STATSCHANGE_HEALTHLOSS then
        doCreatureSetSkullType(attacker, SKULL_WHITE)
    end
    return true
end
function onTarget(cid, target)
    if isPlayer(cid) and getCreatureSkullType(cid) ~= SKULL_WHITE and isMonster(target) and getCreatureName(target) == monsterName then
        doCreatureSetSkullType(cid, SKULL_WHITE)
    end
    return true
end
function onLogin(cid)
    registerCreatureEvent(cid, "skullStatsChange")
    registerCreatureEvent(cid, "skullTarget")
    return true
end

 

mt obrigado!

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