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
LeoTKL
26 de junho de 2017 às 00:09
Agora, Nogard disse:

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

 

 

ta subindo +1000 de mana como se fosse cura ... não aumentar o maxmana só subiu 1000 como se tivesse usado uma mana potion

erro no console nao tinha visto 

 

[26/06/2017 00:01:51] [Error - TalkAction Interface] 

[26/06/2017 00:01:51] data/talkactions/scripts/sagatran.lua:onSay

[26/06/2017 00:01:51] Description: 

[26/06/2017 00:01:51] data/talkactions/scripts/sagatran.lua:57: attempt to perform arithmetic on field 'health' (a nil value)

[26/06/2017 00:01:52] stack traceback:

[26/06/2017 00:01:52]     data/talkactions/scripts/sagatran.lua:57: in function <data/talkactions/scripts/sagatran.lua:3>

 

NogardN
26 de junho de 2017 às 00:12

agora tenta assim:

 

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

 e me informa a mensagem em vermelho que aparecer.

LeoTKL
26 de junho de 2017 às 00:16
Agora, Nogard disse:

agora tenta assim:

 

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

 e me informa a mensagem em vermelho que aparecer.

[26/06/2017 00:06:09] [Error - TalkAction Interface] 

[26/06/2017 00:06:09] data/talkactions/scripts/sagatran.lua:onSay

[26/06/2017 00:06:09] Description: 

[26/06/2017 00:06:09] data/talkactions/scripts/sagatran.lua:59: attempt to perform arithmetic on field 'health' (a nil value)

[26/06/2017 00:06:09] stack traceback:

[26/06/2017 00:06:09]     data/talkactions/scripts/sagatran.lua:59: in function <data/talkactions/scripts/sagatran.lua:3>

 

 

ficou perdendo 1000 de mana

 

mensagem em vermelho é a quantidade que devia ganhar 2000 a saga 1 e 4000 a saga 2

NogardN
26 de junho de 2017 às 00:20
if  tonumber(t[1]) ~= getPlayerStorageValue(cid, sagaTransformacao.storage) then         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "param = " .. tonumber(t[1]) .. "\nstorage = " .. getPlayerStorageValue(cid, sagaTransformacao.storage))            doCreatureAddMana(cid, - transform.mana)            doCreatureAddHealth(cid, - transform.health)            setCreatureMaxMana(cid, getCreatureMaxMana(cid) - sagaTransformacao.mana)             setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - sagaTransformacao.health)                        end

 

 

me informa de novo a mensagem em vermelho.

LeoTKL
26 de junho de 2017 às 00:25
Agora, Nogard disse:
if  tonumber(t[1]) ~= getPlayerStorageValue(cid, sagaTransformacao.storage) then         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "param = " .. tonumber(t[1]) .. "\nstorage = " .. getPlayerStorageValue(cid, sagaTransformacao.storage))            doCreatureAddMana(cid, - transform.mana)            doCreatureAddHealth(cid, - transform.health)            setCreatureMaxMana(cid, getCreatureMaxMana(cid) - sagaTransformacao.mana)             setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - sagaTransformacao.health)                        end

 

 

me informa de novo a mensagem em vermelho.

[26/06/2017 00:15:29] [Error - TalkAction Interface] 

[26/06/2017 00:15:29] data/talkactions/scripts/sagatran.lua:onSay

[26/06/2017 00:15:29] Description: 

[26/06/2017 00:15:29] data/talkactions/scripts/sagatran.lua:59: attempt to perform arithmetic on field 'health' (a nil value)

[26/06/2017 00:15:29] stack traceback:

[26/06/2017 00:15:29]     data/talkactions/scripts/sagatran.lua:59: in function <data/talkactions/scripts/sagatran.lua:3>

 

tirou 1k de mana e apareceu 2000 em vermelho que seria a vida e a mana que deveria ganhar

NogardN
26 de junho de 2017 às 00:27

 

 

em vermelho vai aparecer algo como:

 

param = xxxx

storage = xxxx

 

 

 

 if  tonumber(t[1]) ~= getPlayerStorageValue(cid, sagaTransformacao.storage) then         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "param = " .. tonumber(t[1]) .. "\nstorage = " .. getPlayerStorageValue(cid, sagaTransformacao.storage))            doCreatureAddMana(cid, - transform.mana)            doCreatureAddHealth(cid, - transform.health)            setCreatureMaxMana(cid, getCreatureMaxMana(cid) - transform.mana)             setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - transform.health)                        end

 

 

em cima eu acho que você não trocou a função

Editado Junho 26 por Nogard

LeoTKL
26 de junho de 2017 às 00:59
22 minutos atrás, Nogard disse:

 

 

em vermelho vai aparecer algo como:

 

param = xxxx

storage = xxxx

 

 

 

 if  tonumber(t[1]) ~= getPlayerStorageValue(cid, sagaTransformacao.storage) then         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "param = " .. tonumber(t[1]) .. "\nstorage = " .. getPlayerStorageValue(cid, sagaTransformacao.storage))            doCreatureAddMana(cid, - transform.mana)            doCreatureAddHealth(cid, - transform.health)            setCreatureMaxMana(cid, getCreatureMaxMana(cid) - transform.mana)             setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - transform.health)                        end

 

 

em cima eu acho que você não trocou a função

agora eu perdi a vida e a mana que deveria ganhar ... e apareceu isso

 

00:49 param = 1

storage = -1

 

junto com o erro no console

 

[26/06/2017 00:49:52] [Error - TalkAction Interface] 

[26/06/2017 00:49:52] data/talkactions/scripts/sagatran.lua:onSay

[26/06/2017 00:49:52] Description: 

[26/06/2017 00:49:52] data/talkactions/scripts/sagatran.lua:59: attempt to perform arithmetic on field 'mana' (a nil value)

[26/06/2017 00:49:52] stack traceback:

[26/06/2017 00:49:52]     data/talkactions/scripts/sagatran.lua:59: in function <data/talkactions/scripts/sagatran.lua:3>

 

 

NogardN
26 de junho de 2017 às 01:09

uma dúvida, o player tá dizendo "saga!!"?

LeoTKL
26 de junho de 2017 às 01:14
Agora, Nogard disse:

uma dúvida, o player tá dizendo "saga!!"?

não

NogardN
26 de junho de 2017 às 01:21

tenta:

 

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        -- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "param = " .. tonumber(t[1]) .. "\nstorage = " .. getPlayerStorageValue(cid, sagaTransformacao.storage))            doCreatureAddMana(cid, - saga[getPlayerVocation(cid)].mana)            doCreatureAddHealth(cid, - saga[getPlayerVocation(cid)].health)            setCreatureMaxMana(cid, getCreatureMaxMana(cid) - transform.mana)             setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - transform.health)                    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!")   doCreatureSay(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)                else                  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você já está transformado nessa saga.")                 end                                                                                           return trueend

 

LeoTKL
26 de junho de 2017 às 02:46
1 hora atrás, Nogard disse:

tenta:

 

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        -- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "param = " .. tonumber(t[1]) .. "\nstorage = " .. getPlayerStorageValue(cid, sagaTransformacao.storage))            doCreatureAddMana(cid, - saga[getPlayerVocation(cid)].mana)            doCreatureAddHealth(cid, - saga[getPlayerVocation(cid)].health)            setCreatureMaxMana(cid, getCreatureMaxMana(cid) - transform.mana)             setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - transform.health)                    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!")   doCreatureSay(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)                else                  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você já está transformado nessa saga.")                 end                                                                                           return trueend

 

deu este erro

 

[26/06/2017 02:37:03] [Error - TalkAction Interface] 

[26/06/2017 02:37:03] data/talkactions/scripts/sagatran.lua:onSay

[26/06/2017 02:37:03] Description: 

[26/06/2017 02:37:03] data/talkactions/scripts/sagatran.lua:57: attempt to perform arithmetic on field 'mana' (a nil value)

[26/06/2017 02:37:03] stack traceback:

[26/06/2017 02:37:03]     data/talkactions/scripts/sagatran.lua:57: in function <data/talkactions/scripts/sagatran.lua:3>

 

NogardN
26 de junho de 2017 às 02:57

posta sua lib.

LeoTKL
26 de junho de 2017 às 03:27
20 minutos atrás, Nogard disse:

posta sua lib.

 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

     }

NogardN
26 de junho de 2017 às 16:37
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, transform.storage) then        -- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "param = " .. tonumber(t[1]) .. "\nstorage = " .. getPlayerStorageValue(cid, sagaTransformacao.storage))            doCreatureAddMana(cid, - transform.mana)            doCreatureAddHealth(cid, - transform.health)            setCreatureMaxMana(cid, getCreatureMaxMana(cid) - transform.mana)             setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - transform.health)                    setPlayerStorageValue(cid, transform.storage, tonumber(t[1]))      doSetCreatureOutfit(cid, {lookType = transform.outfit}, -1)     doSendMagicEffect(getThingPos(cid), transform.effect)    doPlayerSendTextMessage(cid, 25, "Voce escolheu uma nova saga!")   doCreatureSay(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)                else                  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você já está transformado nessa saga.")                 end                                                                                           return trueend

 

Editado Junho 26 por Nogard

LeoTKL
26 de junho de 2017 às 21:00
4 horas atrás, 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, transform.storage) then        -- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "param = " .. tonumber(t[1]) .. "\nstorage = " .. getPlayerStorageValue(cid, sagaTransformacao.storage))            doCreatureAddMana(cid, - transform.mana)            doCreatureAddHealth(cid, - transform.health)            setCreatureMaxMana(cid, getCreatureMaxMana(cid) - transform.mana)             setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - transform.health)                    setPlayerStorageValue(cid, transform.storage, tonumber(t[1]))      doSetCreatureOutfit(cid, {lookType = transform.outfit}, -1)     doSendMagicEffect(getThingPos(cid), transform.effect)    doPlayerSendTextMessage(cid, 25, "Voce escolheu uma nova saga!")   doCreatureSay(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)                else                  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você já está transformado nessa saga.")                 end                                                                                           return trueend

 

só não ta aumentando o max health e mana ta ganhando como se fosse cura não ta aumentando ;/