Postado Março 20, 2022 3 anos Versão do Servidor: TFS - 0.4 Tipo de Script: Globalevent Código: Spoiler local msg = { ['20:20'] = {text = 'Evento Up Aberto No Segundo Andar Do Temple', type = 21}, ['20:25'] = {text = 'Evento Up Aberto No Segundo Andar Do Temple', type = 21}, ['20:30'] = {text = 'Evento Up Aberto No Segundo Andar Do Temple', type = 21}, ['20:35'] = {text = 'Evento Up Aberto No Segundo Andar Do Temple', type = 21} } function onThink(interval, lastExecution) local h = msg[os.date('%X'):sub(1, 5)] return h and doBroadcastMessage(h.text, h.type) or true end Queria que falasse apenas em dias específicos (configurável), no caso seria Sábado, Domingo, Terça E Quinta
Postado Março 24, 2022 3 anos Solução local msg = { ["Sunday"] = { --segunda ['20:20'] = {text = 'Evento Up Aberto No Segundo Andar Do Temple', type = 21}, }, ["Tuesday"] = { --terça ['20:25'] = {text = 'Evento Up Aberto No Segundo Andar Do Temple', type = 21}, }, ["Thursday"] = { --quinta ['20:30'] = {text = 'Evento Up Aberto No Segundo Andar Do Temple', type = 21}, }, ["Saturday"] = { --sexta ['20:35'] = {text = 'Evento Up Aberto No Segundo Andar Do Temple', type = 21}, }, } function onThink(interval, lastExecution) local day = os.date("%A") local hours = os.date('%X'):sub(1, 5) if (msg[day][hours]) then local tab_val = msg[day][hours] return tab_val and doBroadcastMessage(tab_val.text, tab_val.type) or true end end
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.