Ir para conteúdo

Featured Replies

  • Respostas 15
  • Visualizações 1.8k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • @victor4312  local config = { name = "Demon", -- Nome do Summon max = 1, -- Máximo de summons storage = 42355, -- Storage que permite o uso exaust_sto = 5555, -- Storage que c

  • @CaioPinaa Você não detalhou muito bem, então testa assim: local monster = "Demon" -- Monster name function onUse(cid, item, fromPosition, itemEx, toPosition) local pos = getCreaturePosition(

  • @victor4312  local config = { name = "Demon", -- Nome do Summon storage = 42355, -- Storage que permite o uso exaust_sto = 5555, -- Storage que contabiliza o exaust exaust_tim

Postado

@victor4312 

local config = {
    
    name = "Demon", -- Nome do Summon
    storage = 42355, -- Storage que permite o uso
    exaust_sto = 5555, -- Storage que contabiliza o exaust
    exaust_time = 60 -- Segundos de Exaust
    
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local pos = getCreaturePosition(cid)
    if getPlayerStorageValue(cid, config.storage) == 1 then
        if not exhaustion.check(cid, config.exaust_sto) then
            local target = doCreateMonster(config.name, pos)
            doConvinceCreature(cid, target)
            doSendMagicEffect(pos, CONST_ME_TELEPORT)
            exhaustion.set(cid, config.exaust_sto, config.exaust_time)
            return true
        else
            doPlayerSendTextMessage(cid, 27, "Exhaustion!! Wait ".. exhaustion.get(cid, config.exaust_sto) .." seconds.")
            doSendMagicEffect(pos, POFF)
            return false
        end
    else
        doPlayerSendTextMessage(cid, 27, "voce nao tem a storage necessaria")
        doSendMagicEffect(pos, POFF)
        return false 
    end
    return true
end

 

Postado

@victor4312 

local config = {
    
    name = "Demon", -- Nome do Summon
    max = 1, -- Máximo de summons
    storage = 42355, -- Storage que permite o uso
    exaust_sto = 5555, -- Storage que contabiliza o exaust
    exaust_time = 60 -- Segundos de Exaust
    
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local pos = getCreaturePosition(cid)
    if getPlayerStorageValue(cid, config.storage) == 1 then
        if not exhaustion.check(cid, config.exaust_sto) then
            if table.maxn(getCreatureSummons(cid)) <= config.max then
                local target = doCreateMonster(config.name, pos)
                doConvinceCreature(cid, target)
                doPlayerSendTextMessage(cid, 27, "Voce invocou o monstro ".. config.name .."!!")
                doSendMagicEffect(pos, CONST_ME_TELEPORT)
                exhaustion.set(cid, config.exaust_sto, config.exaust_time)
                return true
            else
                doPlayerSendTextMessage(cid, 27, "Você ja tem a quantidade máxima de summons ativos!")
                doSendMagicEffect(pos, POFF)
                return false 
            end
        else
            doPlayerSendTextMessage(cid, 27, "Exhaustion!! Wait ".. exhaustion.get(cid, config.exaust_sto) .." seconds.")
            doSendMagicEffect(pos, POFF)
            return false
        end
    else
        doPlayerSendTextMessage(cid, 27, "voce nao tem a storage necessaria")
        doSendMagicEffect(pos, POFF)
        return false 
    end
    return true
end

 

@CaioPinaa 

local monster = "Demon" -- Monster name
local max = 1 -- Max de summons ativos

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local pos = getCreaturePosition(cid)
    if table.maxn(getCreatureSummons(cid)) < max then
        local target = doCreateMonster(monster, pos)
        doConvinceCreature(cid, target)
        doSendMagicEffect(pos, 5)
    else
        doPlayerSendTextMessage(cid, 27, "Você ja tem a quantidade máxima de summons ativos!")
        doSendMagicEffect(pos, POFF)
        return false 
    end
    return true
end

 

Postado

@victor4312 Substitui na script;

doPlayerSendTextMessage(cid, 27, "Espere ".. math.floor(exhaustion.get(cid, config.exaust_sto) / 60) .." minuto(s) e ".. exhaustion.get(cid, config.exaust_sto) - (math.floor(exhaustion.get(cid, config.exaust_sto) / 60)*60) .." segundo(s) para usar seu pet novamente.")

 

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 520.1k

Informação Importante

Confirmação de Termo