vexler222
Active Member
- Joined
- Apr 22, 2012
- Messages
- 714
- Solutions
- 15
- Reaction score
- 46
Hi, how i can add exhaust for this item (Teleport Scroll)? I try but it not work
Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 10000))
function onUse(cid, item)
if hasCondition(cid, CONDITION_INFIGHT) == TRUE then
doPlayerSendCancel(cid, "You may not use this scroll while in-fight!")
return FALSE
end
if hasCondition(cid, CONDITION_EXHAUST) == FALSE then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
else doPlayerSendCancel(cid, "You can use this scroll one time per 10 second")
end
return TRUE
end