Hello,
i have that script:
And when i wanna use them, error "You are exchausted".
Someone know where is a bug?
Tfs 0.3.6 [8.54]
Thanks for any help,
Erexo.
i have that script:
LUA:
function onUse(cid, item, frompos, item2, topos)
local level = getPlayerLevel(cid)
local mlevel = getPlayerMagLevel(cid)
local exhausted_seconds = 1
local exhausted_storagevalue = 74
if(item.type >= 1) then
if(os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then
if(isPlayer(cid) == 1) then
doSendMagicEffect(topos,40)
doCreatureAddMana(cid, math.floor(getCreatureMaxMana(cid)*0.20))
doCreatureAddHealth(cid, math.floor(getCreatureMaxHealth(cid)*0.20))
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
doChangeTypeItem(item.uid, item.type - 1)
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exchausted.")
end
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exhausted.")
end
else
if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue)) then
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exhausted.")
else
if(isPlayer(cid) == 1) then
doSendMagicEffect(topos,40)
doCreatureAddMana(cid, math.floor(getCreatureMaxMana(cid)*0.20))
doCreatureAddHealth(cid, math.floor(getCreatureMaxHealth(cid)*0.20))
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
doRemoveItem(item.uid, 1)
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exchausted.")
end
end
end
return 1
end
And when i wanna use them, error "You are exchausted".
Someone know where is a bug?
Tfs 0.3.6 [8.54]
Thanks for any help,
Erexo.