It is probably due to the login function, you can try this:
local config = {
rate = 2,
storage = 1000,
expstorage = 1100,
register = 1200,
time = 10800
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, config.storage) <= 0 then...