Donio
Banned User
Hello, im trying to make a rune or EVEN the ultimate healing pot for knights to heal depending on their level + magic level.. This is how far I'v come-- But the thing is it Dont work!
If any one can see whats causing it to not work please help me out!
If any one can see whats causing it to not work please help me out!
Code:
local runes = {
[2275] = {
voc = {4, 8},
min = 'level * 1 + maglv * 3 - 2',
max = 'level * 1 + maglv * 4'
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local i = runes[item.itemid]
if isInArray(i.voc, getPlayerVocation(cid)) then
if isPlayer(itemEx.uid) == TRUE then
level, maglv = getPlayerLevel(cid), getPlayerMagLevel(cid)
doPlayerAddHealth(cid, math.random(loadstring('return '..i.min)(), loadstring('return '..i.max)()))
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
doCreatureSay(itemEx.uid, "Aaaah..", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 0)
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_CANONLYUSETHISRUNEONCREATURES)
end
else
doPlayerSendCancel(cid, 'Your vocation cannot use this rune.')
end
return true
end