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.






info
Grupo: Campones
Registrado: 19/02/16
Posts: 95
Reputação: +27
Gênero: Outro
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