How to add exhaustion = 15000
LUA:
local storage = 11989
local protectiontime = 15
local function endProtection(cid)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Protection ended.")
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, storage) >= os.time() then
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, "You are still protected by this doll.")
return true
end
setPlayerStorageValue(cid, storage, os.time()+protectiontime)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You are now protected by this doll for 15 seconds.')
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_GREEN)
addEvent(endProtection, 15000, cid)
return true
end