LE
pedido scripts

[Resolvido] [Saga System] Script pedir uma storage antes de transformar

Por LeoTK, 25 de jun. de 2017 em Resolvidos

58
5.1k
NogardN
25 de junho de 2017 às 22:15
local sagaTransformacao = saga[getPlayerVocation(cid)]

coloca /\

 

 

depois de function onSay()

 

 

 

Editado Junho 25 por Nogard

LeoTKL
25 de junho de 2017 às 22:39
14 minutos atrás, Nogard disse:
local sagaTransformacao = saga[getPlayerVocation(cid)]

coloca /\

 

 

depois de function onSay()

 

 

 

eu consegui fazer pegar assim

 

Spoiler

local cooldownzin = 3 -- em segundos para esperar a talkaction novamente

 

function onSay(cid, words, param, channel)

local sagaTransformacao = saga[getPlayerVocation(cid)]

    

    if(param == '') then --                                                                                   *caso nao digite o numero

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o numero da saga que voce deseja.")

        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)

        return true

    end

    

    local t = string.explode(param, ",")

    local transform = sagaTransformacao[tonumber(t[1])]

    

    if not sagaTransformacao then --                                                                                    *caso saga diferente

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode trocar de saga.")

        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)

        return true

    end

    

    if getPlayerLevel(cid) < transform.level then --                                                                *caso nao tenha level correspondente a transformacao

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao tem level ".. transform.level .. ".")

        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)

        return true 

    end 

    

    if getPlayerStorageValue(cid, transform.storage) < 0 then             

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce ainda nao completou a saga")

        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)

        return true

    end

    

    if getPlayerStorageValue(cid, 5432) >= os.time() then

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode usar ainda, espere ".. getPlayerStorageValue(cid, 5432) - os.time() .." segundos. ")

        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)

        return true

    end 

    

    if (t[2]) then

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Could not understand.")

        return true

    end

    

    

    if not (tonumber(t[1])) then

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o numero da saga que voce deseja.")

        return true

    end

    

    for i=1, #sagaTransformacao do

        if getPlayerStorageValue(cid, sagaTransformacao.storage) >= 0 then 

            doCreatureAddMana(cid, -sagaTransformacao.mana)

            doCreatureAddHealth(cid, -sagaTransformacao.health)

            setCreatureMaxMana(cid, getCreatureMaxMana(cid) - sagaTransformacao.mana) 

            setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - sagaTransformacao.health)

        end

    end

            

    if tonumber(t[1]) > #sagaTransformacao or tonumber(t[1]) < 1 then

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Essa saga nao existe.")

        return true

    end

        doSetCreatureOutfit(cid, {lookType = transform.outfit}, -1)

        doSendMagicEffect(getThingPos(cid), transform.effect)

        doPlayerSendTextMessage(cid, 25, "Voce escolheu uma nova saga!")

        doPlayerSay(cid, "Saga!!", TALKTYPE_ORANGE_1)

        setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + transform.health) 

        setCreatureMaxMana(cid, getCreatureMaxMana(cid) + transform.mana) 

        doCreatureAddMana(cid, getCreatureMaxMana(cid))

        doCreatureAddHealth(cid, getCreatureMaxHealth(cid))

        doPlayerSetStorageValue(cid, 5432, os.time() + cooldownzin)

    

    return true

end

 

lib

 

Citar

 saga = {

    [1] = {{outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 4000, health = 4000}},

    [2] = {{outfit = 66, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}}, 

    [3] = {{outfit = 91, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}}, 

    [4] = {{outfit = 18, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}}, 

    [5] = {{outfit = 31, level = 36, storage = 2930, mana = 2000, health = 3000},{outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}},

     effect = 111

     }

 

mas ai o player só perde vida ao transformar ... 

NogardN
25 de junho de 2017 às 22:45

tenta:

 

 doCreatureAddHealth(cid, - getCreatureHealth(cid) + getCreatureMaxHealth(cid))

 

LeoTKL
25 de junho de 2017 às 23:00
5 minutos atrás, Nogard disse:

tenta:

 

 doCreatureAddHealth(cid, - getCreatureHealth(cid) + getCreatureMaxHealth(cid))

 

continua perdendo

NogardN
25 de junho de 2017 às 23:03
for i=1, #sagaTransformacao do        if getPlayerStorageValue(cid, sagaTransformacao.storage) >= 0 then             doCreatureAddMana(cid, -sagaTransformacao.mana)            doCreatureAddHealth(cid, -sagaTransformacao.health)            setCreatureMaxMana(cid, getCreatureMaxMana(cid) - sagaTransformacao.mana)             setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - sagaTransformacao.health)        end    end

 

 

o que pretendia exatamente adicionando isso?

LeoTKL
25 de junho de 2017 às 23:10
Agora, Nogard disse:
for i=1, #sagaTransformacao do        if getPlayerStorageValue(cid, sagaTransformacao.storage) >= 0 then             doCreatureAddMana(cid, -sagaTransformacao.mana)            doCreatureAddHealth(cid, -sagaTransformacao.health)            setCreatureMaxMana(cid, getCreatureMaxMana(cid) - sagaTransformacao.mana)             setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - sagaTransformacao.health)        end    end

 

 

o que pretendia exatamente adicionando isso?

cada transformação vai dar uma vida a mais porém ao sair da transformação ou mudar para outra ele perde essa e ganha o da proxima ou não ganha nada

vida e mana

NogardN
25 de junho de 2017 às 23:14

se for assim, usa uma storage só e retorna o valor da vocação.

 

 

LeoTKL
25 de junho de 2017 às 23:17
Agora, Nogard disse:

se for assim, usa uma storage só e retorna o valor da vocação.

 

 

no caso ficaria como porque ele ja verifica uma storage no script não daria conflito?

NogardN
25 de junho de 2017 às 23:27

tenta dessa forma:

 

local cooldownzin = 3 -- em segundos para esperar a talkaction novamentefunction onSay(cid, words, param, channel)local sagaTransformacao = saga[getPlayerVocation(cid)]        if(param == '') then --                                                                                   *caso nao digite o numero        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o numero da saga que voce deseja.")        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)        return true    end        local t = string.explode(param, ",")    local transform = sagaTransformacao[tonumber(t[1])]        if not sagaTransformacao then --                                                                                    *caso saga diferente        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode trocar de saga.")        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)        return true    end        if getPlayerLevel(cid) < transform.level then --                                                                *caso nao tenha level correspondente a transformacao        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao tem level ".. transform.level .. ".")        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)        return true     end         if getPlayerStorageValue(cid, transform.storage) < 0 then                     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce ainda nao completou a saga")        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)        return true    end        if getPlayerStorageValue(cid, 5432) >= os.time() then        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode usar ainda, espere ".. getPlayerStorageValue(cid, 5432) - os.time() .." segundos. ")        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)        return true    end         if (t[2]) then        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Could not understand.")        return true    end            if not (tonumber(t[1])) then        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o numero da saga que voce deseja.")        return true    end                if tonumber(t[1]) > #sagaTransformacao or tonumber(t[1]) < 1 then        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Essa saga nao existe.")        return true    end         for i=1, #sagaTransformacao do        if  tonumber(t[1]) ~= getPlayerStorageValue(cid, sagaTransformacao.storage) then             doCreatureAddMana(cid, -sagaTransformacao.mana)            doCreatureAddHealth(cid, -sagaTransformacao.health)            setCreatureMaxMana(cid, getCreatureMaxMana(cid) - sagaTransformacao.mana)             setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - sagaTransformacao.health)                        end    end                    setPlayerStorageValue(cid, sagaTransformacao.storage, tonumber(t[1]))      doSetCreatureOutfit(cid, {lookType = transform.outfit}, -1)     doSendMagicEffect(getThingPos(cid), transform.effect)    doPlayerSendTextMessage(cid, 25, "Voce escolheu uma nova saga!")   doPlayerSay(cid, "Saga!!", TALKTYPE_ORANGE_1)     setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + transform.health)    setCreatureMaxMana(cid, getCreatureMaxMana(cid) + transform.mana)      doCreatureAddMana(cid, getCreatureMaxMana(cid))       doCreatureAddHealth(cid, getCreatureMaxHealth(cid))        setPlayerStorageValue(cid, 5432, os.time() + cooldownzin)                                                                                           return trueend

 

Editado Junho 25 por Nogard

LeoTKL
25 de junho de 2017 às 23:48
11 minutos atrás, Nogard disse:

tenta dessa forma:

 

local cooldownzin = 3 -- em segundos para esperar a talkaction novamentefunction onSay(cid, words, param, channel)local sagaTransformacao = saga[getPlayerVocation(cid)]        if(param == '') then --                                                                                   *caso nao digite o numero        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o numero da saga que voce deseja.")        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)        return true    end        local t = string.explode(param, ",")    local transform = sagaTransformacao[tonumber(t[1])]        if not sagaTransformacao then --                                                                                    *caso saga diferente        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode trocar de saga.")        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)        return true    end        if getPlayerLevel(cid) < transform.level then --                                                                *caso nao tenha level correspondente a transformacao        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao tem level ".. transform.level .. ".")        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)        return true     end         if getPlayerStorageValue(cid, transform.storage) < 0 then                     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce ainda nao completou a saga")        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)        return true    end        if getPlayerStorageValue(cid, 5432) >= os.time() then        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode usar ainda, espere ".. getPlayerStorageValue(cid, 5432) - os.time() .." segundos. ")        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)        return true    end         if (t[2]) then        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Could not understand.")        return true    end            if not (tonumber(t[1])) then        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o numero da saga que voce deseja.")        return true    end                if tonumber(t[1]) > #sagaTransformacao or tonumber(t[1]) < 1 then        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Essa saga nao existe.")        return true    end         for i=1, #sagaTransformacao do        if  tonumber(t[1]) ~= getPlayerStorageValue(cid, sagaTransformacao.storage) then             doCreatureAddMana(cid, -sagaTransformacao.mana)            doCreatureAddHealth(cid, -sagaTransformacao.health)            setCreatureMaxMana(cid, getCreatureMaxMana(cid) - sagaTransformacao.mana)             setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - sagaTransformacao.health)                        end    end                    setPlayerStorageValue(cid, sagaTransformacao.storage, tonumber(t[1]))      doSetCreatureOutfit(cid, {lookType = transform.outfit}, -1)     doSendMagicEffect(getThingPos(cid), transform.effect)    doPlayerSendTextMessage(cid, 25, "Voce escolheu uma nova saga!")   doPlayerSay(cid, "Saga!!", TALKTYPE_ORANGE_1)     setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + transform.health)    setCreatureMaxMana(cid, getCreatureMaxMana(cid) + transform.mana)      doCreatureAddMana(cid, getCreatureMaxMana(cid))       doCreatureAddHealth(cid, getCreatureMaxHealth(cid))        setPlayerStorageValue(cid, 5432, os.time() + cooldownzin)                                                                                           return trueend

 

[25/06/2017 23:38:34] [Error - TalkAction Interface] 

[25/06/2017 23:38:34] data/talkactions/scripts/sagatran.lua:onSay

[25/06/2017 23:38:34] Description: 

[25/06/2017 23:38:34] data/talkactions/scripts/sagatran.lua:57: attempt to perform arithmetic on field 'mana' (a nil value)

[25/06/2017 23:38:34] stack traceback:

[25/06/2017 23:38:34]     data/talkactions/scripts/sagatran.lua:57: in function <data/talkactions/scripts/sagatran.lua:3>

 

NogardN
25 de junho de 2017 às 23:53

testa com alguma vocação que exista no índice da array, de preferência 1

LeoTKL
25 de junho de 2017 às 23:58
Agora, Nogard disse:

testa com alguma vocação que exista no índice da array, de preferência 1

[25/06/2017 23:48:41] [Error - TalkAction Interface] 

[25/06/2017 23:48:41] data/talkactions/scripts/sagatran.lua:onSay

[25/06/2017 23:48:41] Description: 

[25/06/2017 23:48:41] (luaDoCreatureAddHealth) Creature not found

 

se eu fico alterando entre as sagas vai ganhando vida até o infinito não perde só ganha na hora que troca de uma para outra ganha a da outra e acumula com a que ja estava num clico infinito

NogardN
26 de junho de 2017 às 00:02
local cooldownzin = 3 -- em segundos para esperar a talkaction novamentefunction onSay(cid, words, param, channel)local sagaTransformacao = saga[getPlayerVocation(cid)]        if(param == '') then --                                                                                   *caso nao digite o numero        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o numero da saga que voce deseja.")        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)        return true    end        local t = string.explode(param, ",")    local transform = sagaTransformacao[tonumber(t[1])]        if not sagaTransformacao then --                                                                                    *caso saga diferente        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode trocar de saga.")        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)        return true    end        if getPlayerLevel(cid) < transform.level then --                                                                *caso nao tenha level correspondente a transformacao        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao tem level ".. transform.level .. ".")        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)        return true     end         if getPlayerStorageValue(cid, transform.storage) < 0 then                     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce ainda nao completou a saga")        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)        return true    end        if getPlayerStorageValue(cid, 5432) >= os.time() then        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode usar ainda, espere ".. getPlayerStorageValue(cid, 5432) - os.time() .." segundos. ")        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)        return true    end         if (t[2]) then        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Could not understand.")        return true    end            if not (tonumber(t[1])) then        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o numero da saga que voce deseja.")        return true    end                if tonumber(t[1]) > #sagaTransformacao or tonumber(t[1]) < 1 then        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Essa saga nao existe.")        return true    end            if  tonumber(t[1]) ~= getPlayerStorageValue(cid, sagaTransformacao.storage) then             doCreatureAddMana(cid, - sagaTransformacao.mana)            doCreatureAddHealth(cid, -sagaTransformacao.health)            setCreatureMaxMana(cid, getCreatureMaxMana(cid) - sagaTransformacao.mana)             setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - sagaTransformacao.health)                        end                    setPlayerStorageValue(cid, sagaTransformacao.storage, tonumber(t[1]))      doSetCreatureOutfit(cid, {lookType = transform.outfit}, -1)     doSendMagicEffect(getThingPos(cid), transform.effect)    doPlayerSendTextMessage(cid, 25, "Voce escolheu uma nova saga!")   doPlayerSay(cid, "Saga!!", TALKTYPE_ORANGE_1)     setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + transform.health)    setCreatureMaxMana(cid, getCreatureMaxMana(cid) + transform.mana)      doCreatureAddMana(cid, getCreatureMaxMana(cid))       doCreatureAddHealth(cid, getCreatureMaxHealth(cid))        setPlayerStorageValue(cid, 5432, os.time() + cooldownzin)                                                                                           return trueend

 

LeoTKL
26 de junho de 2017 às 00:04
Agora, Nogard disse:
local cooldownzin = 3 -- em segundos para esperar a talkaction novamentefunction onSay(cid, words, param, channel)local sagaTransformacao = saga[getPlayerVocation(cid)]        if(param == '') then --                                                                                   *caso nao digite o numero        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o numero da saga que voce deseja.")        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)        return true    end        local t = string.explode(param, ",")    local transform = sagaTransformacao[tonumber(t[1])]        if not sagaTransformacao then --                                                                                    *caso saga diferente        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode trocar de saga.")        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)        return true    end        if getPlayerLevel(cid) < transform.level then --                                                                *caso nao tenha level correspondente a transformacao        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao tem level ".. transform.level .. ".")        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)        return true     end         if getPlayerStorageValue(cid, transform.storage) < 0 then                     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce ainda nao completou a saga")        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)        return true    end        if getPlayerStorageValue(cid, 5432) >= os.time() then        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode usar ainda, espere ".. getPlayerStorageValue(cid, 5432) - os.time() .." segundos. ")        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)        return true    end         if (t[2]) then        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Could not understand.")        return true    end            if not (tonumber(t[1])) then        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o numero da saga que voce deseja.")        return true    end                if tonumber(t[1]) > #sagaTransformacao or tonumber(t[1]) < 1 then        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Essa saga nao existe.")        return true    end            if  tonumber(t[1]) ~= getPlayerStorageValue(cid, sagaTransformacao.storage) then             doCreatureAddMana(cid, - sagaTransformacao.mana)            doCreatureAddHealth(cid, -sagaTransformacao.health)            setCreatureMaxMana(cid, getCreatureMaxMana(cid) - sagaTransformacao.mana)             setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - sagaTransformacao.health)                        end                    setPlayerStorageValue(cid, sagaTransformacao.storage, tonumber(t[1]))      doSetCreatureOutfit(cid, {lookType = transform.outfit}, -1)     doSendMagicEffect(getThingPos(cid), transform.effect)    doPlayerSendTextMessage(cid, 25, "Voce escolheu uma nova saga!")   doPlayerSay(cid, "Saga!!", TALKTYPE_ORANGE_1)     setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + transform.health)    setCreatureMaxMana(cid, getCreatureMaxMana(cid) + transform.mana)      doCreatureAddMana(cid, getCreatureMaxMana(cid))       doCreatureAddHealth(cid, getCreatureMaxHealth(cid))        setPlayerStorageValue(cid, 5432, os.time() + cooldownzin)                                                                                           return trueend

 

[25/06/2017 23:55:18] [Error - TalkAction Interface] 

[25/06/2017 23:55:18] data/talkactions/scripts/sagatran.lua:onSay

[25/06/2017 23:55:18] Description: 

[25/06/2017 23:55:18] data/talkactions/scripts/sagatran.lua:56: attempt to perform arithmetic on field 'mana' (a nil value)

[25/06/2017 23:55:18] stack traceback:

[25/06/2017 23:55:18]     data/talkactions/scripts/sagatran.lua:56: in function <data/talkactions/scripts/sagatran.lua:3>

 

NogardN
26 de junho de 2017 às 00:07

tenta assim e me diz o que ocorreu:

 

if  tonumber(t[1]) ~= getPlayerStorageValue(cid, sagaTransformacao.storage) then             doCreatureAddMana(cid, 1000)            doCreatureAddHealth(cid, -sagaTransformacao.health)            setCreatureMaxMana(cid, getCreatureMaxMana(cid) - sagaTransformacao.mana)             setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - sagaTransformacao.health)                        end