• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Experience rune, error

sibbe

New Member
Joined
Oct 28, 2007
Messages
51
Reaction score
0
This error appears in my console when players are using a certain rune.

[27/11/2009 22:57:36] Lua Script Error: [Action Interface]
[27/11/2009 22:57:36] in a timer event called from:
[27/11/2009 22:57:36] data/actions/scripts/exp.lua:eek:nUse

[27/11/2009 22:57:36] luaDoPlayerSetStorageValue(). Player not found

Here is the script:
-- Credits: Slawkens
local config = {
rate = 2.0, -- 2.0 = 2x faster than normal
time = 15, -- in minutes
storage = 20532
}

local function experienceEnd(cid)
if isPlayer(cid) then
doPlayerSetExperienceRate(cid, 1.0)
setPlayerStorageValue(tid, config.storage, -1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has passed.")
end
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
local tid = itemEx.uid or cid
if(not isPlayer(tid)) then
return false
end

local status = getPlayerStorageValue(tid, config.storage)
if(status ~= -1) then
doPlayerSendTextMessage(tid, MESSAGE_INFO_DESCR, "Your extra experience rate is already activated! It will expire at: " .. os.date("%X", status))
return true
end

doPlayerSendTextMessage(tid, MESSAGE_INFO_DESCR, "Your extra experience rate has been activated! It is now multiplied by: " .. config.rate .. ".")
doPlayerSetExperienceRate(tid, config.rate)
setPlayerStorageValue(tid, config.storage, os.time() + config.time * 60 * 1000)
doRemoveItem(item.uid, 1)
addEvent(experienceEnd, config.time * 60 * 1000, tid)
return true
end

And login.lua
local config = {
storage = 20532
}

function onLogin(cid)
if(getPlayerStorageValue(cid, config.storage) ~= -1) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate is gone.")
setPlayerStorageValue(cid, config.storage)
end
return true
end
 
Last edited:
Back
Top