Ir para conteúdo

Featured Replies

Postado

Galera, vi um evento do @zipter98 fez e achei legal, mas nao estou conseguindo configurar ele, tipo eu quero ele como actionid 3434 e o evento não fechar, porque o dele fecha :(

 

evento criado por @zipter98

  Citar

 

 

local configuration = {
    day = "Saturday",
    to_pos = {x = x, y = y, z = z},    --Para onde o teleport levará.
    pos = {x = x, y = y, z = z},       --Onde o teleport será criado.
    teleport_id = 1387,                --ID do teleport.
}
function onTime()
    if os.date("%A") == configuration.day then
        local item = getTileItemById(configuration.pos, configuration.teleport_id).uid
       
if item > 0 then
            doRemoveItem(item, 1)
            broadcastMessage("Castle War foi fechado.", MESSAGE_STATUS_WARNING)
        else
            doCreateTeleport(configuration.teleport_id, configuration.to_pos, configuration.pos)
            broadcastMessage("Castle War foi aberto.", MESSAGE_STATUS_WARNING)
        end
    end
    return true
end

 

  Citar

 

Tags

<globalevent name="SaturdayTp" time="18:00" event="script" value="saturdaytp.lua"/>
<globalevent name="CloseTp" time="21:00" event="script" value="saturdaytp.lua"/>

 

Resolvido por zipter98

Ir para solução
Postado
  • Solução

local configuration = {
    day = "Saturday",
    to_pos = {x = x, y = y, z = z},    --Para onde o teleport levará.
    pos = {x = x, y = y, z = z},       --Onde o teleport será criado.
    teleport_id = 1387,                --ID do teleport.
    aid = 3434,                        --Action ID do teleport.
}
function onTime()
    if os.date("%A") == configuration.day then
        local item = getTileItemById(configuration.pos, configuration.teleport_id).uid
        if item < 1 then
            local tp = doCreateTeleport(configuration.teleport_id, configuration.to_pos, configuration.pos)
            doItemSetAttribute(tp, "aid", configuration.aid)
            broadcastMessage("Castle War foi aberto.", MESSAGE_STATUS_WARNING)
        end
    end
    return true
end

não respondo pms solicitando suporte em programação/scripting

Postado
  • Autor
  Em 07/02/2015 em 22:57, zipter98 disse:
local configuration = {
    day = "Saturday",
    to_pos = {x = x, y = y, z = z},    --Para onde o teleport levará.
    pos = {x = x, y = y, z = z},       --Onde o teleport será criado.
    teleport_id = 1387,                --ID do teleport.
    aid = 3434,                        --Action ID do teleport.
}
function onTime()
    if os.date("%A") == configuration.day then
        local item = getTileItemById(configuration.pos, configuration.teleport_id).uid
        if item < 1 then
            local tp = doCreateTeleport(configuration.teleport_id, configuration.to_pos, configuration.pos)
            doItemSetAttribute(tp, "aid", configuration.aid)
            broadcastMessage("Castle War foi aberto.", MESSAGE_STATUS_WARNING)
        end
    end
    return true
end

 

 

CARA SOU SEU FÃ, VOCÊ SEMPRE ME AJUDA :wow:  :wow:  :wow:  :wow:  :wow:  :wow:  :wow:  :wow:

Postado

local configuration = {
    day = "Saturday",
    to_pos = {x = x, y = y, z = z},    --Para onde o teleport levará.
    pos = {x = x, y = y, z = z},       --Onde o teleport será criado.
    teleport_id = 1387,                --ID do teleport.
    aid = 3434,                        --Action ID do teleport.
    time = 10,                         --Tempo para fechar, em minutos.
}
function onTime()
    if os.date("%A") == configuration.day then
        local item = getTileItemById(configuration.pos, configuration.teleport_id).uid
        if item < 1 then
            local tp = doCreateTeleport(configuration.teleport_id, configuration.to_pos, configuration.pos)
            doItemSetAttribute(tp, "aid", configuration.aid)
            broadcastMessage("Castle War foi aberto.", MESSAGE_STATUS_WARNING)
            addEvent(function()
                tp = getTileItemById(configuration.pos, configuration.teleport_id).uid
                if tp and tp > 0 then
                    doRemoveItem(tp)
                    broadcastMessage("Teleportes fechados.")
                end
            end, configuration.time * 60 * 1000)
        end
    end
    return true
end

não respondo pms solicitando suporte em programação/scripting

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.6k

Informação Importante

Confirmação de Termo