Ir para conteúdo

Featured Replies

  • Respostas 10
  • Visualizações 1.3k
  • Created
  • Última resposta

Top Posters In This Topic

Postado

O código já existe, procure melhor no fórum da próxima vez.

 

-- By Luquinha for TibiaKing
-- <action itemid="id do item" event="script" value="potionexp.lua"/>

local config = {

rate = 2,

time = 15, -- AQUI É QUANTOS MINUTOS VAI FICAR O DOUBLE

storage = 21002

}

local function endExpRate(cid)

    if isPlayer(cid) then
    
        doPlayerSetRate(cid, SKILL__LEVEL, 1)
        setPlayerStorageValue(cid, config.storage, -1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "O efeito da Double Exp Potion acabou!")
    end
end

function onUse(cid, item, fromPosition, itemEx, toPosition)

    if(getPlayerStorageValue(cid, config.storage) < 0) then
            
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sua experiencia foi dobrada durante ".. config.time .." minutos.")
            doSendMagicEffect(getPlayerPosition(cid), 28)
            doCreatureSay(cid,'Double Experience Actived!', TALKTYPE_ORANGE_1)
            doPlayerSetRate(cid, SKILL__LEVEL, config.rate)
            setPlayerStorageValue(cid, config.storage, os.time() + config.time * 60)
            addEvent(endExpRate, config.time * 60 * 1000, cid)
            doRemoveItem(item.uid, 1)
            
    else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você ainda está sob o efeito da Double Exp Potion, espere acabar o tempo para usa-la novamente.")
    end
    return true
end

 

Postado
  • Autor

Desculpa, sou novato.

 

Não funcionou, não sei se fiz algo errado.

 

-- By Luquinha for TibiaKing
-- <action itemid="7529" event="script" value="expscroll.lua"/>


local config = {

rate = 2,

time = 15, -- AQUI É QUANTOS MINUTOS VAI FICAR O DOUBLE

storage = 21002

}

local function endExpRate(cid)

    if isPlayer(cid) then
    
        doPlayerSetRate(cid, SKILL__LEVEL, 1)
        setPlayerStorageValue(cid, config.storage, -1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "O efeito da Double Exp Potion acabou!")
    end
end

function onUse(cid, item, fromPosition, itemEx, toPosition)

    if(getPlayerStorageValue(cid, config.storage) < 0) then
            
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sua experiencia foi dobrada durante ".. config.time .." minutos.")
            doSendMagicEffect(getPlayerPosition(cid), 28)
            doCreatureSay(cid,'Double Experience Actived!', TALKTYPE_ORANGE_1)
            doPlayerSetRate(cid, SKILL__LEVEL, config.rate)
            setPlayerStorageValue(cid, config.storage, os.time() + config.time * 60)
            addEvent(endExpRate, config.time * 60 * 1000, cid)
            doRemoveItem(item.uid, 1)
            
    else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você ainda está sob o efeito da Double Exp Potion, espere acabar o tempo para usa-la novamente.")
    end
    return true
end

Postado
17 minutos atrás, Sotten disse:

Desculpa, sou novato.

 

Não funcionou, não sei se fiz algo errado.

 

-- By Luquinha for TibiaKing
-- <action itemid="7529" event="script" value="expscroll.lua"/>


local config = {

rate = 2,

time = 15, -- AQUI É QUANTOS MINUTOS VAI FICAR O DOUBLE

storage = 21002

}

local function endExpRate(cid)

    if isPlayer(cid) then
    
        doPlayerSetRate(cid, SKILL__LEVEL, 1)
        setPlayerStorageValue(cid, config.storage, -1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "O efeito da Double Exp Potion acabou!")
    end
end

function onUse(cid, item, fromPosition, itemEx, toPosition)

    if(getPlayerStorageValue(cid, config.storage) < 0) then
            
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sua experiencia foi dobrada durante ".. config.time .." minutos.")
            doSendMagicEffect(getPlayerPosition(cid), 28)
            doCreatureSay(cid,'Double Experience Actived!', TALKTYPE_ORANGE_1)
            doPlayerSetRate(cid, SKILL__LEVEL, config.rate)
            setPlayerStorageValue(cid, config.storage, os.time() + config.time * 60)
            addEvent(endExpRate, config.time * 60 * 1000, cid)
            doRemoveItem(item.uid, 1)
            
    else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você ainda está sob o efeito da Double Exp Potion, espere acabar o tempo para usa-la novamente.")
    end
    return true
end


Qual erro deu ?

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo