Works, let me ask a improvement (if u can):
*remove on use
*cooldown of 10 minutes
*message if is in cooldown
*message success, like "you feel reborning", something like that
local config = {
remove = true,
-- If you want to disable cooldown, simply set a number less than 1
cooldown = {
time = 60, -- seconds
storage = 000
},
effect = CONST_ME_STUN
}
function onUse(cid, item, fromPos, itemEx, toPos)
if config.cooldown.time >= 1 then
if getCreatureStorage(cid, config.cooldown.storage) > os.time() then
return doPlayerSendCancel(cid, "You can only use this item every " .. config.cooldown.time .. " seconds, please wait.")
end
doCreatureSetStorage(cid...
function onUse(cid, item, fromPos, itemEx, toPos)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
end
Works, let me ask a improvement (if u can):Should look something like this, I can't recall if those are the function names, but you can figure that out
LUA:function onUse(cid, item, fromPos, itemEx, toPos) doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid)) doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid)) end
Works, let me ask a improvement (if u can):
*remove on use
*cooldown of 10 minutes
*message if is in cooldown
*message success, like "you feel reborning", something like that
local config = {
remove = true,
-- If you want to disable cooldown, simply set a number less than 1
cooldown = {
time = 60, -- seconds
storage = 000
},
effect = CONST_ME_STUN
}
function onUse(cid, item, fromPos, itemEx, toPos)
if config.cooldown.time >= 1 then
if getCreatureStorage(cid, config.cooldown.storage) > os.time() then
return doPlayerSendCancel(cid, "You can only use this item every " .. config.cooldown.time .. " seconds, please wait.")
end
doCreatureSetStorage(cid, config.cooldown.storage, os.time() + config.cooldown.time)
end
if config.remove then
doRemoveItem(item.uid)
end
if config.effect then
doSendMagicEffect(getThingPosition(cid), config.effect)
end
-- doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "You feel reborning.")
doCreatureSay(cid, "You feel reborning.", TALKTYPE_ORANGE_2)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
return true
end