Trying to make all the runes to only work for the right voc but keep getting a error
Script.
Error. Gyazo - 9dd46684581094aa8693e08b8ac6e757.png
(think thats all you need to know )
Script.
Lua:
local exhausted = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhausted, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))
function onUse(cid, item, fromPosition, itemEx, toPosition)
local min, max
local lvl, mag = getPlayerLevel(cid), getPlayerMagLevel(cid)
if isSorcerer(cid) or isDruid(cid) then
min = lvl * 0 + mag * 0
max = lvl * 0 + mag * 0
doPlayerSendCancel(cid, "This can only be used by knights.")
elseif isPaladin(cid) then
min = lvl * 0 + mag * 0
max = lvl * 0 + mag * 0
doPlayerSendCancel(cid, "This can only be used by knights.")
elseif isKnight(cid) then
min = lvl * 8.6 + mag * 6.3
max = lvl * 8.9 + mag * 6.5
end
local rand = math.random(min, max)
if rand > 10000 then
rand = 10000
end
if rand < 100 then
rand = 0
end
if hasCondition(cid, CONDITION_EXHAUST_HEAL) then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
end
if not isPlayer(itemEx.uid) then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
end
return
if isKnight(cid) then
doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE) and doCreatureAddHealth(itemEx.uid, rand) and doAddCondition(cid, exhausted) and doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
else
doPlayerSendCancel(cid, "This can only be used by knights.")
end
end
Error. Gyazo - 9dd46684581094aa8693e08b8ac6e757.png
(think thats all you need to know )
Last edited: