Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

Galera tenho esses 3 scripts, pro castle war funcionar no meu servidor, ele esta configurado pra quarta e sabado gostaria de colocar pra segunda/quarta e sabado. Alguem pode ajudar?

 

tpcastle.lua

Spoiler

local configuration = {
    day = "Saturday",
    day2 = "Wednesday",
    to_pos = {x = 654, y = 652, z = 7},
    pos = {x = 99, y = 191, z = 7},
    
    to_pos1 = {x = 650, y = 671, z = 8},
    pos1 = {x = 647, y = 669, z = 7},

    teleport_id = 1387,
}
local CTF1 = {
    fromPos = {x=614, y=645, z=8, stackpos=253},
    toPos = {x=718, y=783, z=8, stackpos=253},
    deTile = {x=655,y=399,z=7,stackpos=1}
}
local CTF2 = {
    fromPos = {x=643, y=722, z=9, stackpos=253},
    toPos = {x=670, y=741, z=9, stackpos=253},
    deTile = {x=655,y=399,z=7,stackpos=1}
}
local CTF3 = {
    fromPos = {x=622, y=647, z=7, stackpos=253},
    toPos = {x=723, y=778, z=7, stackpos=253},
    deTile = {x=655,y=399,z=7,stackpos=1}
}
local CTF4 = {
    fromPos = {x=627, y=677, z=6, stackpos=253},
    toPos = {x=712, y=775, z=6, stackpos=253},
    deTile = {x=655,y=399,z=7,stackpos=1}
}
local CTF5 = {
    fromPos = {x=627, y=677, z=5, stackpos=253},
    toPos = {x=712, y=775, z=5, stackpos=253},
    deTile = {x=655,y=399,z=7,stackpos=1}
}
local CTF6 = {
    fromPos = {x=627, y=677, z=4, stackpos=253},
    toPos = {x=712, y=775, z=4, stackpos=253},
    deTile = {x=655,y=399,z=7,stackpos=1}
}
function onTime()
    if os.date("%A") == configuration.day then
        local item = getTileItemById(configuration.pos, configuration.teleport_id).uid
        local item1 = getTileItemById(configuration.pos1, configuration.teleport_id).uid
        if item > 0 then
            doRemoveItem(item, 1)
            doRemoveItem(item1, 1)
            broadcastMessage("O Castle War foi fechado. Próxima abertura será no próximo sábado às 18h.", MESSAGE_STATUS_WARNING)
             for _, pid in ipairs(getPlayersOnline()) do
              if isInArea(getPlayerPosition(pid), CTF1.fromPos, CTF1.toPos) then
               doTeleportThing(pid, CTF1.deTile, false)
              end
              if isInArea(getPlayerPosition(pid), CTF2.fromPos, CTF2.toPos) then
               doTeleportThing(pid, CTF2.deTile, false)
              end
               if isInArea(getPlayerPosition(pid), CTF3.fromPos, CTF3.toPos) then
               doTeleportThing(pid, CTF3.deTile, false)
              end
               if isInArea(getPlayerPosition(pid), CTF4.fromPos, CTF4.toPos) then
               doTeleportThing(pid, CTF4.deTile, false)
              end
               if isInArea(getPlayerPosition(pid), CTF5.fromPos, CTF5.toPos) then
               doTeleportThing(pid, CTF5.deTile, false)
              end
              if isInArea(getPlayerPosition(pid), CTF6.fromPos, CTF6.toPos) then
               doTeleportThing(pid, CTF6.deTile, false)
              end
             end
        else
            doCreateTeleport(configuration.teleport_id, configuration.to_pos, configuration.pos)
            doCreateTeleport(configuration.teleport_id, configuration.to_pos1, configuration.pos1)
            broadcastMessage("O Castle War foi aberto. Quem passará a ser a nova guild dominante?", MESSAGE_STATUS_WARNING)
        end
    end
    if os.date("%A") == configuration.day2 then
        local item = getTileItemById(configuration.pos, configuration.teleport_id).uid
        local item1 = getTileItemById(configuration.pos1, configuration.teleport_id).uid
        if item > 0 then
            doRemoveItem(item, 1)
            doRemoveItem(item1, 1)
            broadcastMessage("O Castle War foi fechado. Próxima abertura será no próximo sábado às 18h.", MESSAGE_STATUS_WARNING)
            for _, pid in ipairs(getPlayersOnline()) do
              if isInArea(getPlayerPosition(pid), CTF1.fromPos, CTF1.toPos) then
               doTeleportThing(pid, CTF1.deTile, false)
              end
              if isInArea(getPlayerPosition(pid), CTF2.fromPos, CTF2.toPos) then
               doTeleportThing(pid, CTF2.deTile, false)
              end
               if isInArea(getPlayerPosition(pid), CTF3.fromPos, CTF3.toPos) then
               doTeleportThing(pid, CTF3.deTile, false)
              end
               if isInArea(getPlayerPosition(pid), CTF4.fromPos, CTF4.toPos) then
               doTeleportThing(pid, CTF4.deTile, false)
              end
               if isInArea(getPlayerPosition(pid), CTF5.fromPos, CTF5.toPos) then
               doTeleportThing(pid, CTF5.deTile, false)
              end
              if isInArea(getPlayerPosition(pid), CTF6.fromPos, CTF6.toPos) then
               doTeleportThing(pid, CTF6.deTile, false)
              end
             end
        else
            doCreateTeleport(configuration.teleport_id, configuration.to_pos, configuration.pos)
            doCreateTeleport(configuration.teleport_id, configuration.to_pos1, configuration.pos1)
            broadcastMessage("O Castle War foi aberto e fechará as 21h. Quem passará a ser a nova guild dominante?", MESSAGE_STATUS_WARNING)
        end
    end
    return true
end

 

tpautomatico.lua

Spoiler

local configuration = {
    day = "Saturday",
    day2 = "Wednesday",
    to_pos2 = {x = 642, y = 731, z = 7},
    pos2 = {x = 642, y = 729, z = 7},
    
    to_pos3 = {x = 642, y = 707, z = 7},
    pos3 = {x = 642, y = 709, z = 7},
    
    teleport_id = 1387,                --ID do teleport.
}
function onTime()
    if os.date("%A") == configuration.day then
        local item2 = getTileItemById(configuration.pos2, configuration.teleport_id).uid
        local item3 = getTileItemById(configuration.pos3, configuration.teleport_id).uid
        if item2 > 0 then
            doRemoveItem(item2, 1)
            doRemoveItem(item3, 1)
            broadcastMessage("O teleport de dentro do Castle War foi fechado e abrirá novamente em 15 minutos.", MESSAGE_STATUS_WARNING)
        else
            doCreateTeleport(configuration.teleport_id, configuration.to_pos2, configuration.pos2)
            doCreateTeleport(configuration.teleport_id, configuration.to_pos3, configuration.pos3)
            broadcastMessage("O teleport de dentro do Castle War foi aberto e fechará em 5 minutos.", MESSAGE_STATUS_WARNING)
        end
    end
    if os.date("%A") == configuration.day2 then
        local item2 = getTileItemById(configuration.pos2, configuration.teleport_id).uid
        local item3 = getTileItemById(configuration.pos3, configuration.teleport_id).uid
        if item2 > 0 then
            doRemoveItem(item2, 1)
            doRemoveItem(item3, 1)
            broadcastMessage("O teleport de dentro do Castle War foi fechado e abrirá novamente em 15 minutos.", MESSAGE_STATUS_WARNING)
        else
            doCreateTeleport(configuration.teleport_id, configuration.to_pos2, configuration.pos2)
            doCreateTeleport(configuration.teleport_id, configuration.to_pos3, configuration.pos3)
            broadcastMessage("O teleport de dentro do Castle War foi aberto e fechará em 5 minutos.", MESSAGE_STATUS_WARNING)
        end
    end
    return true
end

 

Tpautomaticolast.lua

Spoiler

local configuration = {
    day = "Saturday",
    day2 = "Wednesday",
    to_pos2 = {x = 642, y = 731, z = 7},
    pos2 = {x = 642, y = 729, z = 7},
    
    to_pos3 = {x = 642, y = 707, z = 7},
    pos3 = {x = 642, y = 709, z = 7},
    
    teleport_id = 1387,                --ID do teleport.
}
function onTime()
    if os.date("%A") == configuration.day then
        local item2 = getTileItemById(configuration.pos2, configuration.teleport_id).uid
        local item3 = getTileItemById(configuration.pos3, configuration.teleport_id).uid
        if item2 > 0 then
            doRemoveItem(item2, 1)
            doRemoveItem(item3, 1)
            broadcastMessage("O último teleport de dentro do Castle War foi fechado.", MESSAGE_STATUS_WARNING)
        else
            doCreateTeleport(configuration.teleport_id, configuration.to_pos2, configuration.pos2)
            doCreateTeleport(configuration.teleport_id, configuration.to_pos3, configuration.pos3)
            broadcastMessage("O último teleport de dentro do Castle War foi aberto e fechará em 5 minutos.", MESSAGE_STATUS_WARNING)
        end
    end
    if os.date("%A") == configuration.day2 then
        local item2 = getTileItemById(configuration.pos2, configuration.teleport_id).uid
        local item3 = getTileItemById(configuration.pos3, configuration.teleport_id).uid
        if item2 > 0 then
            doRemoveItem(item2, 1)
            doRemoveItem(item3, 1)
            broadcastMessage("O último teleport de dentro do Castle War foi fechado.", MESSAGE_STATUS_WARNING)
        else
            doCreateTeleport(configuration.teleport_id, configuration.to_pos2, configuration.pos2)
            doCreateTeleport(configuration.teleport_id, configuration.to_pos3, configuration.pos3)
            broadcastMessage("O último teleport de dentro do Castle War foi aberto e fechará em 5 minutos.", MESSAGE_STATUS_WARNING)
        end
    end
    return true
end

 

Postado

 

Citar

Dias da semana em inglês

 

Domingo – Sunday

Segunda-feira – Monday

Terça-feira – Tuesday

Quarta-feira – Wednesday

Quinta-feira – Thursday

Sexta-feira – Friday

Sábado – Saturday

É só trocar onde tem day e day2.  Sobre adicionar mais um dia,terá que alterar o script todo.

Contribuições:
 

=> Distribuições/Servidores

  1. [8.60] The Forgotten Server 1.3 (COMPILADO WIN x64)

 

=> Scripts/Códigos/Tutoriais

  1. Pokemon pescado aparece em volta do seu pokemon
  2. [Gesior]Dobrar pontos PagSeguro a partir de x valor doado

 

 Gostou de alguma contribuição? Rep +?

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

Informação Importante

Confirmação de Termo