Ir para conteúdo
  • 0

Mudar esse código para 0.3.6


Emooooo

Pergunta

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local str = {"\nSpiritual Shielding", "\nEmbrace of Tibia", "\nFire of the Suns", "\nSpark of the Phoenix", "\nWisdom of Solitude", "\nTwist of Fate"}
    local result = "Received blessings:"
    local player = Player(cid)
    for i = 1, 6 do
        result = player:hasBlessing(i) and result .. str or result
    end
    
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 20 > result:len() and "No blessings received." or result)
    return true
end

Link para o comentário
Compartilhar em outros sites

4 respostass a esta questão

Posts Recomendados

  • 0
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local str = {"\nSpiritual Shielding", "\nEmbrace of Tibia", "\nFire of the Suns", "\nSpark of the Phoenix", "\nWisdom of Solitude", "\nTwist of Fate"}
    local result = "Received blessings:"
    for i = 1, 6 do
        result = getPlayerBlessing(cid, i) and result .. str or result
    end
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 20 > result:len() and "No blessings received." or result)
    return true
end

 

Editado por luis700
Link para o comentário
Compartilhar em outros sites

  • 0

vou testa vlw ^^,

10 horas atrás, luis700 disse:

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local str = {"\nSpiritual Shielding", "\nEmbrace of Tibia", "\nFire of the Suns", "\nSpark of the Phoenix", "\nWisdom of Solitude", "\nTwist of Fate"}
    local result = "Received blessings:"
    for i = 1, 6 do
        result = getPlayerBlessing(cid, i) and result .. str or result
    end
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 20 > result:len() and "No blessings received." or result)
    return true
end

 

 

deu esse erro ae !!

 

22/8/2018 8:33:44] [Error - Action Interface] 
[22/8/2018 8:33:44] data/actions/scripts/other/checkbless.lua:onUse
[22/8/2018 8:33:44] Description: 
[22/8/2018 8:33:44] data/actions/scripts/other/checkbless.lua:5: attempt to concatenate local 'str' (a table value)
[22/8/2018 8:33:44] stack traceback:
[22/8/2018 8:33:44]     data/actions/scripts/other/checkbless.lua:5: in function <data/actions/scripts/other/checkbless.lua:1>

 

Link para o comentário
Compartilhar em outros sites

  • 0
1 hora atrás, Emooooo disse:

vou testa vlw ^^,

 

deu esse erro ae !!

 

22/8/2018 8:33:44] [Error - Action Interface] 
[22/8/2018 8:33:44] data/actions/scripts/other/checkbless.lua:onUse
[22/8/2018 8:33:44] Description: 
[22/8/2018 8:33:44] data/actions/scripts/other/checkbless.lua:5: attempt to concatenate local 'str' (a table value)
[22/8/2018 8:33:44] stack traceback:
[22/8/2018 8:33:44]     data/actions/scripts/other/checkbless.lua:5: in function <data/actions/scripts/other/checkbless.lua:1>

 

Agora vai, testei aqui e deu certo.

 

function onUse(cid, item, frompos, item2, topos)
	local str = {"\nSpiritual Shielding", "\nEmbrace of Tibia", "\nFire of the Suns", "\nSpark of the Phoenix", "\nWisdom of Solitude", "\nTwist of Fate"}
    local result = "Received blessings:"
    for i = 1, 6 do
        result = getPlayerBlessing(cid, i) and result.. str[i] or result
    end
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 20 > result:len() and "No blessings received." or result)
    return true
end

 

Link para o comentário
Compartilhar em outros sites

  • 0
29 minutos atrás, luis700 disse:

Agora vai, testei aqui e deu certo.

 


function onUse(cid, item, frompos, item2, topos)
	local str = {"\nSpiritual Shielding", "\nEmbrace of Tibia", "\nFire of the Suns", "\nSpark of the Phoenix", "\nWisdom of Solitude", "\nTwist of Fate"}
    local result = "Received blessings:"
    for i = 1, 6 do
        result = getPlayerBlessing(cid, i) and result.. str[i] or result
    end
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 20 > result:len() and "No blessings received." or result)
    return true
end

 

deu certo valeu !

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...