EM
pedido scripts

Mudar esse código para 0.3.6

Por Emooooo, 21 de ago. de 2018 em Scripts

5
1.3k
EmoooooE
21 de agosto de 2018 às 17:33

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

GengoG
21 de agosto de 2018 às 21:41
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 Agosto 21 por luis700

EmoooooE
22 de agosto de 2018 às 08:32

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>

 

GengoG
22 de agosto de 2018 às 09:53
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

 

EmoooooE
22 de agosto de 2018 às 10:23
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 !