xLosT
Member
i need add max level to use in the scripts
PHP:
local exp = 2000000 -- Quanto de experience o player irá ganhar?!
local exhaust = 259200 -- Tempo para o player poder usar o item novamente! (tempo em segundos)
local text = "Congratulations, you gained "..exp.." points of experience."
local storage = 9811 -- Não mexa aqui.
function onUse(cid, item, fromPosition, itemEx, toPosition)
if (getPlayerStorageValue(cid, storage) <= os.time()) then
doPlayerAddExp(cid, exp)
doCreatureSay(cid, text, 19)
doSendMagicEffect(getCreaturePosition(cid), 14)
doRemoveItem(cid, item.uid, 1)
setPlayerStorageValue(cid, storage, os.time()+exhaust)
else
doPlayerSendCancel(cid, "Sorry, you only can again use this item after 3 days.")
end
return TRUE
end