Hello i found this script:
Can anyone change it for random add HP and MP. Now its add 20% always (0.20) but i want to randomize it, like from 20-30%, can anyone help me?
LUA:
function onUse(cid, item, frompos, item2, topos)
local exhausted_seconds = 2
local exhausted_storagevalue = 74
if isPlayer(cid) then
if(os.time() <= getPlayerStorageValue(cid, exhausted_storagevalue)) then
return doPlayerSendCancel(cid, "You are exhausted.")
end
if(item.type >= 1) then
doSendMagicEffect(topos,12)
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(topos,12)
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)
end
end
return true
end
Can anyone change it for random add HP and MP. Now its add 20% always (0.20) but i want to randomize it, like from 20-30%, can anyone help me?