Ir para conteúdo

Featured Replies

  • Respostas 7
  • Visualizações 423
  • Created
  • Última resposta

Top Posters In This Topic

Postado

Ve assim

 

Spoiler

local config = {
    rate = 2.0, -- Rate que vai ficar o Scroll.
    time = 1, -- Tempo dado pelo Scroll. 
    storage = 20011

local function endExpRate(cid)
    if not isPlayer(cid) then
        return
    end
    if(getPlayerStorageValue(cid,20011) == 20011)then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode usar outra scroll ate que a primeira acabe!")
        return false
    else
        doPlayerSetRate(cid, SKILL__LEVEL, 6.0)
        setPlayerStorageValue(cid, config.storage, -1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your extra experience time has ended.")
    end
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local timeLeft = getPlayerStorageValue(cid, 20011)
    if timeLeft > os.time() then
        local timeTable = os.date('*t', timeLeft - (os.time() + 10))
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format("You still have %d %s %d %s %d %s left of extra experience.", timeTable.hour, timeTable.hour > 1 and "hours" or "hour", timeTable.min, timeTable.min > 1 and "minutes" or "minute", timeTable.sec, timeTable.sec > 1 and "seconds" or "second"))
        return true
    end
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, string.format("Your extra experience rate is now: %d. It will last for %d hours.", config.rate, config.time))
        doPlayerSetRate(cid, SKILL__LEVEL, config.rate)
        setPlayerStorageValue(cid, config.storage, os.time() + config.time * 3600 * 100)
        addEvent(endExpRate, config.time * 3600 * 100, cid)
        doRemoveItem(item.uid, 1)
        return true
end

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.8k

Informação Importante

Confirmação de Termo