• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 0.X manarune problem

vexler222

Active Member
Joined
Apr 22, 2012
Messages
714
Solutions
15
Reaction score
46
Hi, i have problem with my mr script it work in 90%? MS/ED/RP can use, ek can't but if i have 500 lvl i still can use it why?

Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 1000))

function onUse(cid, item, fromPosition, itemEx, toPosition)

    local mana_min = (getCreatureMaxMana(cid) / 100) * 9
    local mana_max = (getCreatureMaxMana(cid) / 100) * 10
    local mana_add = math.random(mana_min, mana_max)
    if getPlayerLevel(cid) >= 800 and getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 or getPlayerVocation(cid) == 7 then
    doPlayerAddMana(cid, mana_add)
    doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
    doCreatureSay(itemEx.uid, "Hero MR!", TALKTYPE_ORANGE_1)
    elseif getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8 then
    doCreatureSay(cid, "Only for MS/ED/RP", TALKTYPE_ORANGE_1)
    elseif getPlayerLevel(cid) < 800 then
    doCreatureSay(cid, "You need 800 level!", TALKTYPE_ORANGE_1)
   
end
    return TRUE
end
 
Last edited:
Solution
Try this

Lua:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 1000))

function onUse(cid, item, fromPosition, itemEx, toPosition)

    local mana_min = (getCreatureMaxMana(cid) / 100) * 9
    local mana_max = (getCreatureMaxMana(cid) / 100) * 10
    local mana_add = math.random(mana_min, mana_max)
    if getPlayerLevel(cid) <= 800 then
    doCreatureSay(cid, "level 800 required to use this.", TALKTYPE_ORANGE_1)
    return true
end
    if (isSorcerer(cid) or isDruid(cid) or isPaladin(cid)) then
        doPlayerAddMana(cid, mana_add)
        doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
        doCreatureSay(itemEx.uid...
in line 9 u must have to add id of knight vocation (4)

Lua:
  if getPlayerLevel(cid) >= 800 and getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 or getPlayerVocation(cid) == 7 then
    doPlayerAddMana(cid, mana_add)
 
Try this

Lua:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 1000))

function onUse(cid, item, fromPosition, itemEx, toPosition)

    local mana_min = (getCreatureMaxMana(cid) / 100) * 9
    local mana_max = (getCreatureMaxMana(cid) / 100) * 10
    local mana_add = math.random(mana_min, mana_max)
    if getPlayerLevel(cid) <= 800 then
    doCreatureSay(cid, "level 800 required to use this.", TALKTYPE_ORANGE_1)
    return true
end
    if (isSorcerer(cid) or isDruid(cid) or isPaladin(cid)) then
        doPlayerAddMana(cid, mana_add)
        doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
        doCreatureSay(itemEx.uid, "Hero MR!", TALKTYPE_ORANGE_1)
    else
        doCreatureSay(itemEx.uid, "knights cant use this manarune.", TALKTYPE_ORANGE_1)
    end
    return TRUE
end
 
Solution
Back
Top