Follow along with the video below to see how to install our site as a web app on your home screen.
Notka: This feature may not be available in some browsers.
function onUse(cid, item, frompos, item2, topos)
local level = getPlayerLevel(cid)
-- Exhausted Settings --
local exhausted_seconds = 1 -- How many seconds manarune will be unavailible to use. --
local exhausted_storagevalue = 7001 -- Storage Value to store exhaust. It MUST be unused! --
-- Exhausted Settings END --
-- Health Formula Settings --
-- You can use "level" and "mlevel" --
local health_minimum = (level * 5)
local health_maximum = (level * 5)
-- Health Formula Settings END --
local health_add = math.random(health_minimum, health_maximum)
-- We check the charges. --
if(item.type > 1) then
-- Exhausted check. --
if(os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then
-- Entity is player? --
if(isPlayer(item2.uid) == TRUE or item2.uid == cid) then
doSendMagicEffect(topos,28)
doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
doSendAnimatedText(topos, health_add, TEXTCOLOR_LIGHTBLUE)
doPlayerAddHealth(item2.uid, health_add)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
doChangeTypeItem(item.uid, item.type - 1)
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Tej runy mozesz uzywac tylko na graczach.")
end
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Poczekaj chwilke -.^")
end
else
if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue)) then
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Poczekaj chwilke -.^")
else
if(isPlayer(item2.uid) == TRUE or item2.uid == cid) then
doSendMagicEffect(topos,28)
doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
doSendAnimatedText(topos, health_add, TEXTCOLOR_LIGHTBLUE)
doPlayerAddHealth(item2.uid, health_add)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "Tej runy mozesz uzywac tylko na graczach.")
end
end
end
return 1
end