Postado Agosto 11, 2017 7 anos Fala galera do tk, Eu tenho esse script aqui, que abre meu castle, mas ele abria só sabado e quarta, alterei para todos os dias e esta dando erro, nao abre se n for sabado ou quarta. Alguem pode alterar para abrir todos os dias por favor??? Spoiler local configuration = { day = "Saturday", day2 = "Wednesday", day3 = "Sunday", day4 = "Monday", day5 = "Tuesday", day6 = "Thursday", day7 = "Friday", to_pos = {x = 702, y = 761, z = 7}, pos = {x = 665, y = 392, z = 7}, to_pos1 = {x = 702, y = 761, z = 7}, pos1 = {x = 665, y = 392, 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 e fechará as 20:00h. 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 19h.", 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 20h. Quem passará a ser a nova guild dominante?", MESSAGE_STATUS_WARNING) end end return true end
Postado Agosto 12, 2017 7 anos @gutalo novamente postando em locais errado. Você tem um script, e quer uma alteração nele, ou ele ta com problema, ou tem uma duvida sobre ele, tendo em vista isso, a área correta seria suporte de script, muito fácil deduzir isso. Caso não saiba deduzir, basta ler as descrições das áreas de postagem, ou pensar, "tem área pra pedidos, e tem áreas pra suporte, então as demais áreas são para postagem de conteúdo". Movi seu tópico para área correta. Em relação a seu script, aqui está, funcionando todos os dias, caso queira que não funcione e algum dia, basta remover esse dia da tabela: Spoiler local configuration = { ["Monday"] = 1, -- Segunda! ["Tuesday"] = 2, -- Terça! ["Wednesday"] = 3, -- Quarta! ["Thursday"] = 4, -- Quinta! ["Friday"] = 5, -- Sexta! ["Saturday"] = 6, -- Sabado! ["Sunday"] = 7, -- Domingo! ----------------------------------- to_pos = {x = 702, y = 761, z = 7}, pos = {x = 665, y = 392, z = 7}, ----------------------------------- to_pos1 = {x = 702, y = 761, z = 7}, pos1 = {x = 665, y = 392, 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 configuration[os.date("%A")] 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 20:00h. Quem passará a ser a nova guild dominante?", MESSAGE_STATUS_WARNING) end end return true end Tópico movido para área correta, preste mais atenção na próxima vez, leia as regras de postagem do Tibia King e as descrições de cada seção!
Postado Agosto 12, 2017 7 anos Autor 7 horas atrás, KotZletY disse: @gutalo novamente postando em locais errado. Você tem um script, e quer uma alteração nele, ou ele ta com problema, ou tem uma duvida sobre ele, tendo em vista isso, a área correta seria suporte de script, muito fácil deduzir isso. Caso não saiba deduzir, basta ler as descrições das áreas de postagem, ou pensar, "tem área pra pedidos, e tem áreas pra suporte, então as demais áreas são para postagem de conteúdo". Movi seu tópico para área correta. Em relação a seu script, aqui está, funcionando todos os dias, caso queira que não funcione e algum dia, basta remover esse dia da tabela: Ocultar conteúdo local configuration = { ["Monday"] = 1, -- Segunda! ["Tuesday"] = 2, -- Terça! ["Wednesday"] = 3, -- Quarta! ["Thursday"] = 4, -- Quinta! ["Friday"] = 5, -- Sexta! ["Saturday"] = 6, -- Sabado! ["Sunday"] = 7, -- Domingo! ----------------------------------- to_pos = {x = 702, y = 761, z = 7}, pos = {x = 665, y = 392, z = 7}, ----------------------------------- to_pos1 = {x = 702, y = 761, z = 7}, pos1 = {x = 665, y = 392, 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 configuration[os.date("%A")] 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 20:00h. Quem passará a ser a nova guild dominante?", MESSAGE_STATUS_WARNING) end end return true end Tópico movido para área correta, preste mais atenção na próxima vez, leia as regras de postagem do Tibia King e as descrições de cada seção! Obrigado, e me desculpa denovo. n foi por mal
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.