Postado Fevereiro 7, 2015 10 anos 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 trueend Citar Tags <globalevent name="SaturdayTp" time="18:00" event="script" value="saturdaytp.lua"/><globalevent name="CloseTp" time="21:00" event="script" value="saturdaytp.lua"/>
Postado Fevereiro 7, 2015 10 anos 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 Fevereiro 7, 2015 10 anos 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
Postado Fevereiro 15, 2015 10 anos Como ficaria o script para que ele fosse fechado 10 minutos após a abertura?
Postado Fevereiro 15, 2015 10 anos 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.