UN
action

[PEDIDO] Adicionar exaustão ao script

Por UntFrc, 17 de mar. de 2016 em Scripts

exhaust
script
life
7
1.5k
UntFrcU
17 de março de 2016 às 02:48

Olá, Xtibia. Eu tenho um script action aqui de item que ao dar use nele, ele heala a vida. Porém ele não tem exaustão. Queria saber se alguém não faz a gentileza de adicionar exhaust nele com um intervalo de 15 segundos.
O script é esse:


local config = {

	    remove_on_use = false, -- Remover ao usar?

	    min_heal = 1000, -- Mínimo que pode healar

	    max_heal = 1000 -- Máximo que pode healar

}


function onUse(cid, item)

	    doCreatureAddHealth(cid, math.random(config.min_heal, config.max_heal))

	    doCreatureSay(cid, "Aaah, restauring...", 19)


	    if (config.remove_on_use) then

			    doRemoveItem(item.uid, 1)

	    end


	    return true

end
julhinhuuJ
17 de março de 2016 às 05:28

 

Olá, Xtibia. Eu tenho um script action aqui de item que ao dar use nele, ele heala a vida. Porém ele não tem exaustão. Queria saber se alguém não faz a gentileza de adicionar exhaust nele com um intervalo de 15 segundos.

O script é esse:

 

 

local config = {

	    remove_on_use = false, -- Remover ao usar?

	    min_heal = 1000, -- Mínimo que pode healar

	    max_heal = 1000 -- Máximo que pode healar

}


function onUse(cid, item)

	    doCreatureAddHealth(cid, math.random(config.min_heal, config.max_heal))

	    doCreatureSay(cid, "Aaah, restauring...", 19)


	    if (config.remove_on_use) then

			    doRemoveItem(item.uid, 1)

	    end


	    return true

end

 

Tenta assim:

 

 

local config = {

     remove_on_use = false, -- Remover ao usar?

     min_heal = 1000, -- Mínimo que pode healar

     max_heal = 1000 -- Máximo que pode healar

}


function onUse(cid, item)
if (getPlayerStorageValue(cid, 11577) >= os.time()) then
doCreatureSay(cid, "Você só poderá usar novamente em ".. (getPlayerStorageValue(cid, 11577)-os.time()+(15)) .." segundos. ",
TALKTYPE_ORANGE_1)
return TRUE
end

     doCreatureAddHealth(cid, math.random(config.min_heal, config.max_heal))

     doCreatureSay(cid, "Aaah, restauring...", 19)


     if (config.remove_on_use) then

             doRemoveItem(item.uid, 1)

     end


     return true

end

 

 

obs: Não testei.

UntFrcU
17 de março de 2016 às 05:50

 

Tenta assim:

 

 

local config = {

     remove_on_use = false, -- Remover ao usar?

     min_heal = 1000, -- Mínimo que pode healar

     max_heal = 1000 -- Máximo que pode healar

}


function onUse(cid, item)
if (getPlayerStorageValue(cid, 11577) >= os.time()) then
doCreatureSay(cid, "Você só poderá usar novamente em ".. (getPlayerStorageValue(cid, 11577)-os.time()+(15)) .." segundos. ",
TALKTYPE_ORANGE_1)
return TRUE
end

     doCreatureAddHealth(cid, math.random(config.min_heal, config.max_heal))

     doCreatureSay(cid, "Aaah, restauring...", 19)


     if (config.remove_on_use) then

             doRemoveItem(item.uid, 1)

     end


     return true

end

 

 

obs: Não testei.

 

Não funcionou.

julhinhuuJ
17 de março de 2016 às 05:54
Melhor resposta

Tenta assim:

local config = {

     remove_on_use = false, -- Remover ao usar?

     min_heal = 1000, -- Mínimo que pode healar

     max_heal = 1000 -- Máximo que pode healar

}


function onUse(cid, item)
if (getPlayerStorageValue(cid, 11577) >= os.time()) then
doCreatureSay(cid, "Você só poderá usar novamente em ".. (getPlayerStorageValue(cid, 11577)-os.time()+(0)) .." segundos. ",
TALKTYPE_ORANGE_1)
return TRUE
end

     doCreatureAddHealth(cid, math.random(config.min_heal, config.max_heal))

     setPlayerStorageValue(cid,11577,os.time()+15)


     doCreatureSay(cid, "Aaah, restauring...", 19)


     if (config.remove_on_use) then

             doRemoveItem(item.uid, 1)

     end


     return true
end

Creio que agora vá.

UntFrcU
17 de março de 2016 às 05:56

Tenta assim:

local config = {

     remove_on_use = false, -- Remover ao usar?

     min_heal = 1000, -- Mínimo que pode healar

     max_heal = 1000 -- Máximo que pode healar

}


function onUse(cid, item)
if (getPlayerStorageValue(cid, 11577) >= os.time()) then
doCreatureSay(cid, "Você só poderá usar novamente em ".. (getPlayerStorageValue(cid, 11577)-os.time()+(0)) .." segundos. ",
TALKTYPE_ORANGE_1)
return TRUE
end

     doCreatureAddHealth(cid, math.random(config.min_heal, config.max_heal))

     setPlayerStorageValue(cid,11577,os.time()+15)


     doCreatureSay(cid, "Aaah, restauring...", 19)


     if (config.remove_on_use) then

             doRemoveItem(item.uid, 1)

     end


     return true
end

Creio que agora vá.

 

Agora foi. Obrigado!

julhinhuuJ
17 de março de 2016 às 05:59

 

Agora foi. Obrigado!

Nada foi um prazer ajudar, marque a melhor resposta para que outros vejam que foi resolvido seu pedido e assim movam para a área correta.

FurabioF
17 de março de 2016 às 13:30

Tópico Movido
Este tópico foi movido de "OTServScriptingDownloads ScriptsActions, talkactions e moveevents"
para "OTServScriptingSuporte Scripting".

 

 


Tópico Movido
Este tópico foi movido de "OTServScriptingSuporte Scripting"
para "OTServScriptingSuporte ScriptingPedidos e dúvidas resolvidos - Scripting".