• 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!

Can someone add exhaust to this mr (dont change anything just add)

999109

New Member
Joined
Apr 28, 2009
Messages
42
Reaction score
0
Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1) -- time in seconds x1000

function onUse(cid, item, fromPosition, itemEx, toPosition) 
    local mp = math.random(300, 600)


doPlayerAddMana(cid, mp)
doSendMagicEffect(getThingPos(itemEx.uid),31)
doCreatureSay(itemEx.uid, "Beginner Manarune", TALKTYPE_ORANGE_1)
doSendAnimatedText(getPlayerPosition(cid),""..mp.."",
TEXTCOLOR_GREEN)
    return TRUE
end
 
Last edited by a moderator:
If you are looking for basic things, you can look in other scripts that do the same thing like potions.lua.
Code:
if getCreatureCondition(cid, CONDITION_EXHAUST) then
   doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
   doPlayerSendCancel(cid, "You are exhausted")
   return true
end

doAddCondition(cid, exhaust)
Add it under function onUse since it should check for exhaustion first before adding mana.
Post your server version next time.
 
Back
Top