local function endExpRate(cid) if isPlayer(cid) then doPlayerSetRate(cid, SKILL__LEVEL, 1) doCreatureSetStorage(cid, 1) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Your double experience time has ended.") end end function onUse(cid, item, fromPosition, itemEx, toPosition) if getCreatureStorage(cid, 1) == -1 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "1 hour of double experience added!") doPlayerSetRate(cid, SKILL__LEVEL, 2) doCreatureSetStorage(cid, 1, os.time() + 3600) addEvent(endExpRate, 3600 * 1000, cid) doRemoveItem(item.uid) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You still have double experience time left.") end return true end