I wanna do exhaustion for this "potion-based" script:
Exhaustion inside code, doesn't work ;/
Code:
function onUse(cid, item, frompos, item2, topos)
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 4000)
if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return true
end
if (item.itemid == 5953 and item.type > 1) then
doCreatureAddHealth(cid, math.random(200, 500))
doChangeTypeItem(item.uid,item.type-1)
doSendMagicEffect(topos,12)
doCreatureSay(cid, "Nice weeeed...", TALKTYPE_ORANGE_1)
else
doRemoveItem(item.uid,1)
end
return 1
end
Exhaustion inside code, doesn't work ;/