1268995
Member
- Joined
- Sep 9, 2010
- Messages
- 422
- Reaction score
- 13
Hello guys, this a system and i am having problens in an exhausted script.
Take a look:
Why setPlayerStorageValue(cid, gab.storage, os.time() + gab.exhausted) are NOT working?
Thanks in advanced.
Take a look:
Code:
local gab = {
exhausted = 2.7, -- Time you are exhausted. by second
storage = 91355 -- Storage used for "exhaust."
}
local config = {
storage = 19333,
chance = 10, --- chance de achar um item ou não
k = 2, --- constante de level.. quanto maior, mais fácil é upar. (a fórmula é level ao quadrado dividido pela constante)
experience = 19334
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
(SOME NOT IMPORTANT SCRIPT PART )
(...)
if config.chance >= math.random(1,100) then
if #drops >= 1 then
local item = drops[math.random(1,#drops)]
doPlayerSendTextMessage(cid, 27, "You have found a "..getItemNameById(item)..".")
doPlayerAddItem(cid, item, 1, true)
setPlayerStorageValue(cid, gab.storage, os.time() + gab.exhausted)
end
doSendMagicEffect(toPosition, 3)
setPlayerStorageValue(cid, gab.storage, os.time() + gab.exhausted)
else
doSendMagicEffect(toPosition, 2)
setPlayerStorageValue(cid, gab.storage, os.time() + gab.exhausted)
return true
end
elseif itemEx.itemid == item.itemid then
doPlayerSendTextMessage(cid, 27, "You're currenctly level "..getPlayerStorageValue(cid, config.storage)..".")
else
return false
end
return true
end
Why setPlayerStorageValue(cid, gab.storage, os.time() + gab.exhausted) are NOT working?
Thanks in advanced.
Last edited: