Shakaal
;x
mhm, no just .. He did not want scrola gives lvl .. only at increasing EXP: o
But no Reading Comprehension <3
But no Reading Comprehension <3
creaturescripts/scripts/scroll_login.lua
Code:local storage = 20011 function onLogin(cid) if(getPlayerStorageValue(cid, storage) == 1) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your extra exp rate will expire at: " .. os.date("%X", getPlayerStorageValue(cid, storage))) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You do not have any extra experience time.") end return true end
actions/scripts/Scroll.lua
Code:local config = { rate = 2.0, -- 2x More Experience time = 60, -- Minutes of Exp Time storage = 20011 } function onUse(cid, item, fromPosition, itemEx, toPosition) local tid = itemEx.uid or cid if(isPlayer(tid) ~= TRUE) then return false end if(getPlayerStorageValue(tid, config.storage) == 1) then doPlayerSendTextMessage(tid, MESSAGE_STATUS_CONSOLE_BLUE, "Your extra exp rate will expire at: " .. os.date("%X", getPlayerStorageValue(tid, config.storage))) return true end doPlayerSendTextMessage(tid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your extra experience rate has been activated! It is now: " .. config.rate .. ".") doPlayerSetRate(tid, SKILL__LEVEL, config.rate) setPlayerStorageValue(tid, config.storage, os.time() + config.time * 60 * 1000) addEvent(endExpRate, config.time * 60 * 1000, tid) doRemoveItem(item.uid, 1) return true end local function endExpRate(tid) doPlayerSetRate(tid, SKILL__LEVEL, 1.0) --config.lua rate setPlayerStorageValue(tid, config.storage, -1) doPlayerSendTextMessage(tid, MESSAGE_STATUS_CONSOLE_RED, "Your extra experience time has ended.") end
creaturescripts/scripts/login.lua
Code:registerCreatureEvent(cid, "expRate")
creaturescripts/scripts/expRateCheck.lua
Code:local storage = 20011 function onLogin(cid) if(getPlayerStorageValue(cid, storage) == 1) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your extra exp rate will expire at: " .. os.date("%X", getPlayerStorageValue(tid, config.storage)).") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You do not have any extra experience time.") setPlayerStorageValue(cid, storage, -1) end return true end
Look this, and comment. Please
registerCreatureEvent(cid, "expRate")
local config = {
rate = 2.0, -- 2x More Experience
time = 120, -- Minutes of Exp Time
storage = 20011
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local tid = itemEx.uid or cid
if(isPlayer(tid) == false) then
return false
end
if(getPlayerStorageValue(tid, config.storage) == 1) then
doPlayerSendTextMessage(tid, MESSAGE_STATUS_CONSOLE_BLUE, "You still have extra experience time left.")
return true
end
doPlayerSendTextMessage(tid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your extra experience rate has been activated! It is now: " .. config.rate .. ".")
doPlayerSetRate(tid, SKILL__LEVEL, config.rate)
setPlayerStorageValue(tid, config.storage, os.time() + config.time * 60 * 1000)
addEvent(endExpRate, config.time * 60000, tid)
doRemoveItem(item.uid, 1)
return true
end
local function endExpRate(tid)
doPlayerSetRate(tid, SKILL__LEVEL, 1.0) --config.lua rate
setPlayerStorageValue(tid, config.storage, -1)
doPlayerSendTextMessage(tid, MESSAGE_STATUS_CONSOLE_RED, "Your extra experience time has ended.")
end