Tbol
Well-Known Member
- Joined
- Apr 7, 2019
- Messages
- 526
- Reaction score
- 54
Is it even possible? If player uses potions like 2500 times he gets storage x? And probably it should save it somehow too because if he disconnects the progress wont be lost.
Using this one right now
Using this one right now
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
ITEM = 5279
local storage = 50000
local wait = 1.5
local pos1 = {x = getPlayerPosition(cid).x + 0, y = getPlayerPosition(cid).y + 0, z = getPlayerPosition(cid).z}
if fromPosition.x ~= CONTAINER_POSITION and exhaustion.get(cid, storage) == FALSE then
REG_HEALTH = 2000
REG_MANA = 2000
doPlayerAddMana(cid, REG_MANA)
doCreatureAddHealth(cid, REG_HEALTH)
Player(cid):say("Used potion!", TALKTYPE_SAY)
doSendMagicEffect(pos1, 210)
doRemoveItem(item.uid, 1)
exhaustion.set(cid, storage, wait)
elseif item.itemid == ITEM and exhaustion.get(cid, storage) == FALSE then
REG_HEALTH = 20000
REG_MANA = 20000
doPlayerAddMana(cid, REG_MANA)
doCreatureAddHealth(cid, REG_HEALTH)
Player(cid):say("Used potion!", TALKTYPE_SAY)
doSendMagicEffect(pos1, 210)
doRemoveItem(item.uid,1)
exhaustion.set(cid, storage, wait)
else
doPlayerSendCancel(cid, "You are exhausted.")
end
return TRUE
end