Ir para conteúdo

Featured Replies

Postado
  • Diretor
4 minutos atrás, Doidodepeda disse:

Nenhum error, porem nao sai o ''efeito''

Troca o efeito

 

 

local tab = {
    [4] = 10, -- [vocationID] = número da cor do texto animado
    [5] = 30,
    [6] = 50,
    [7] = 70
}

function ariseText(cid)
    local texts = {"' .    ,", ".    ' ,", "'  .  ,", ",    ' ."}
    doSendAnimatedText(getThingPos(cid), texts[math.random(1, #texts)], tab[getPlayerVocation(cid)])
    if isPlayer(cid) then
        doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_YELLOW)
        addEvent(ariseText, 1000, cid)
    end
    
    return true
end

function getPlayerByGUID(guid)
    for _, pid in ipairs(getPlayersOnline()) do
        if getPlayerGUID(pid) == guid then
            return pid
        end
    end
    return nil
end

function onLogin(cid)
    local player = getPlayerByGUID(cid)
    
    if player then
        if tab[player:getVocation():getId()] then
            ariseText(cid)
        end
    end
    
    return true
end
 

  • Respostas 12
  • Visualizações 349
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • local tab = {     [4] = 10, -- [vocationID] = número da cor do texto animado     [5] = 30,     [6] = 50,     [7] = 70 } function ariseText(cid)     local texts = {"' .    ,", ".    '

  • local tab = {     [4] = 10, -- [vocationID] = número da cor do texto animado     [5] = 30,     [6] = 50,     [7] = 70 } function ariseText(cid)     if not isPlayer(cid) then -- Verifi

Posted Images

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

Troca o efeito

 

 

local tab = {
    [4] = 10, -- [vocationID] = número da cor do texto animado
    [5] = 30,
    [6] = 50,
    [7] = 70
}

function ariseText(cid)
    local texts = {"' .    ,", ".    ' ,", "'  .  ,", ",    ' ."}
    doSendAnimatedText(getThingPos(cid), texts[math.random(1, #texts)], tab[getPlayerVocation(cid)])
    if isPlayer(cid) then
        doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_YELLOW)
        addEvent(ariseText, 1000, cid)
    end
    
    return true
end

function getPlayerByGUID(guid)
    for _, pid in ipairs(getPlayersOnline()) do
        if getPlayerGUID(pid) == guid then
            return pid
        end
    end
    return nil
end

function onLogin(cid)
    local player = getPlayerByGUID(cid)
    
    if player then
        if tab[player:getVocation():getId()] then
            ariseText(cid)
        end
    end
    
    return true
end
 

O efeito continua sem sair ! =[

Postado
  • Diretor

local tab = {
    [4] = 10, -- [vocationID] = número da cor do texto animado
    [5] = 30,
    [6] = 50,
    [7] = 70
}

function ariseText(cid)
    local texts = {"' .    ,", ".    ' ,", "'  .  ,", ",    ' ."}
    doSendAnimatedText(getCreaturePosition(cid), texts[math.random(1, #texts)], tab[getPlayerVocation(cid)])
    if isPlayer(cid) then
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_YELLOW)
        addEvent(ariseText, 1000, cid)
    end
    
    return true
end

function getPlayerByGUID(guid)
    for _, pid in ipairs(getPlayers()) do
        if getPlayerGUID(pid) == guid then
            return pid
        end
    end
    return nil
end

function onLogin(cid)
    local player = getPlayerByGUID(cid)
    
    if player then
        if tab[player:getVocation():getId()] then
            ariseText(cid)
        end
    end
    
    return true
end
 

Postado
  • Autor
4 minutos atrás, L3K0T disse:

local tab = {
    [4] = 10, -- [vocationID] = número da cor do texto animado
    [5] = 30,
    [6] = 50,
    [7] = 70
}

function ariseText(cid)
    local texts = {"' .    ,", ".    ' ,", "'  .  ,", ",    ' ."}
    doSendAnimatedText(getCreaturePosition(cid), texts[math.random(1, #texts)], tab[getPlayerVocation(cid)])
    if isPlayer(cid) then
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_YELLOW)
        addEvent(ariseText, 1000, cid)
    end
    
    return true
end

function getPlayerByGUID(guid)
    for _, pid in ipairs(getPlayers()) do
        if getPlayerGUID(pid) == guid then
            return pid
        end
    end
    return nil
end

function onLogin(cid)
    local player = getPlayerByGUID(cid)
    
    if player then
        if tab[player:getVocation():getId()] then
            ariseText(cid)
        end
    end
    
    return true
end
 

Agora nao deixa o char logar de novo ! =[

 

Citar

[15:55:48.579] [Error - CreatureScript Interface]
[15:55:48.580] data/creaturescripts/scripts/effect_vocation.lua:onLogin
[15:55:48.581] Description:
[15:55:48.582] data/creaturescripts/scripts/effect_vocation.lua:20: attempt to call global 'getPlayers' (a nil value)
[15:55:48.583] stack traceback:
[15:55:48.585]  data/creaturescripts/scripts/effect_vocation.lua:20: in function 'getPlayerByGUID'
[15:55:48.586]  data/creaturescripts/scripts/effect_vocation.lua:29: in function <data/creaturescripts/scripts/effect_vocation.lua:28>

 

Postado
  • Diretor

local tab = {
    [4] = 10, -- [vocationID] = número da cor do texto animado
    [5] = 30,
    [6] = 50,
    [7] = 70
}

function ariseText(cid)
    local texts = {"' .    ,", ".    ' ,", "'  .  ,", ",    ' ."}
    local playerVocation = getPlayerVocation(cid)
    if playerVocation and tab[playerVocation] then
        doSendAnimatedText(getCreaturePosition(cid), texts[math.random(1, #texts)], tab[playerVocation])
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN) -- Efeito mágico adicionado
    end
    if isPlayer(cid) then
        addEvent(ariseText, 1000, cid)
    end
    
    return true
end

function onLogin(cid)
    if tab[getPlayerVocation(cid)] then
        ariseText(cid)
    end
    
    return true
end
 

Editado por L3K0T (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.6k

Informação Importante

Confirmação de Termo