Geekbuddys
Member
- Joined
- Mar 15, 2014
- Messages
- 164
- Reaction score
- 19
Code:
local config = {
rate = 2.0, -- 4x More Experience
time = 3, -- Hours of Exp Time
storage = 200011
}
local function endExpRate(player, cid)
player:setExperienceRate(cid, SKILL__LEVEL, 3.0)
player:setStorageValue(cid, config.storage, -1)
player:sendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience time has ended.")
end
function onUse(player, item, fromPosition, itemEx, toPosition)
if(player:getStorageValue(cid, config.storage) == -1) then
player:sendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate is now: " .. config.rate .. ". It will last for ".. config.time .." hours.")
player:setExperienceRate(cid, SKILL__LEVEL, config.rate)
player:setStorageValue(cid, config.storage, os.time() + config.time * 3600 * 1000)
addEvent(endExpRate, config.time * 3600 * 1000, cid)
player:removeItem(item.uid, 1)
else
player:sendTextMessage(cid, MESSAGE_INFO_DESCR, "You still have extra experience time left.")
end
return true
end
Can't get it work.. i dosent give any error in console. Any one knows whats wrong?