Ir para conteúdo

Featured Replies

Postado
local config = {
 
        storage = 66669,
        storage_time = 66668,
        interval = 10, -- SEGUNDOS
        effect = 30, --EFEITO NO PLAYER
        effect_target = 17, -- EFEITO NO TARGET
    }
 
 
function onUse(cid, item, fromPos, itemEx, toPos)
 
    if item.uid == itemEx.uid then
        if getPlayerStorageValue(cid, config.storage) < 1 then
            doPlayerSendTextMessage(cid, 19, "ATIVADO!!")
            setPlayerStorageValue(cid, config.storage, 1)
            doSendMagicEffect(getThingPos(cid), config.effect)
        else
            setPlayerStorageValue(cid, config.storage, -1)
            doPlayerSendTextMessage(cid, 19, "DESATIVADO!!")
            doSendMagicEffect(getThingPos(cid), config.effect)
        end
        return true
    end
 
    local mana = getCreatureMana(itemEx.uid)

    if not isPlayer(itemEx.uid) and cid ~= itemEx.uid then
        return true and doPlayerSendTextMessage(cid, 19, "Você só pode usar isso em jogadores.") 
    end
 

        if getPlayerStorageValue(cid, config.storage) == 1 then
            if getPlayerStorageValue(cid, config.storage_time) <= os.time() then 
                doCreatureAddMana(cid, mana)
                doPlayerSendTextMessage(cid, 19, "Perfect Copy!!")
                doSendMagicEffect(toPos, config.effect_target)
                setPlayerStorageValue(cid, config.storage_time, os.time() + config.interval)
            else
                doPlayerSendTextMessage(cid, 19, "Falta " .. getPlayerStorageValue(cid, config.storage_time) - os.time() .. "segundos pra usar novamente..." )
            end
        else 
             doPlayerSendTextMessage(cid, 19, "Você precisa ativar o sharingan para usa-lo.")
        end
 
return true
end
<action itemid="IDDOITEM" event="script" value="ARQUIVO.lua"/>

Editado por Shizuo Silva (veja o histórico de edições)

  • Respostas 10
  • Visualizações 436
  • Created
  • Última resposta

Top Posters In This Topic

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