Soristl

Deadfender

Aug 18th, 2020 (edited)
2,086
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 57.13 KB | None | 0 0
  1. admins = {
  2.     ["Refletz#6472"] = true,
  3.     ["Soristl1#0000"] = true,
  4. }
  5. system.disableChatCommandDisplay (nil, true)
  6. tfm.exec.setRoomMaxPlayers(15)
  7. tt = 0
  8. mice = {}
  9. lang = {}
  10. portaisid = {}
  11. lang.br = {
  12.     text1 = "<p align='center'><font size='14px'><font color='#000000'><b>O jogo começa em",
  13.     text2 = "<p align='center'><font size='15px'><a href='event:p'>Clique aqui para participar",
  14.     text3 = "<p align='center'><font size='12px'>Jogadores participando:",
  15.     text4 = "<p align='center'><font size='15px'>Participando",
  16.     text5 = "<p align='center'><font size='13px'>Capacidade Máxima de jogadores atingida.",
  17.     text6 = "<p align='center'><font size='20px'><font face='soopafresh'><bv>Deadfender<n> (Beta)<br><br><font face='Verdana'><font size='12px'>Vá para:<br><br><font color='#FFE300'>Instruções</font> | <a href='event:cmd'>Comandos</a>",
  18.     text7 = "<font size='15px'><bv>Como jogar<n>:<font size='12px'><br><br><br>1- Impeça que o cannon chegue ao 'gol' com pisos que você mesmo ira colocar no mapa através do click;<br><br>2- o cannon irá spawnar em cima da área verde. Use a área verde para colocar os pisos (Com o click), que irão impedir o cannon de chegar ao chão e impedir que vá ao 'gol';<br><br>3- Você pode colocar 2 ou 3 objetos. Vai depender da rodada em que você está.",
  19.     text8 = "<p align='center'><font size='20px'><font face='soopafresh'><bv>Deadfender<n> (Beta)<br><br><font face='Verdana'><font size='12px'>Vá para:<br><br><a href='event:ajuda'>Instruções</a> | <font color='#FFE300'>Comandos</font>",
  20.     text9 = "<font size='15px'><bv>Comandos<n>: -- <rose>*<n> -> Comandos para o admin da sala --<font size='12px'><br><br><br><j>!Resettimer<n> <rose>*<n> - Reseta o tempo de iniciar a partida.<br><j>!lang [BR/EN]<n> - Muda o idioma do jogo.<br><br><br><br><br><br>Programador da ideia: Refletz#6472 (Soristl)<br><br>Agradecimento a todos que colaboraram de alguma forma para a criação deste script ;)",
  21.     text10 = "<p align='center'><font size='12px'><a href='event:vida'>Vida dos jogadores",
  22.     text11 = "<p align='center'><font size='15px'><font color='#D30A0A'>Leia a ajuda para:<br>Instruções | Comandos",
  23.     text12 = "<p align='center'><font size='12px'>Nessa rodada poderá spawnar",
  24.     text13 = "<font size='15px'><font color='#000000'><b>Coloque pisos através do click do mouse, clicando na área <font color='#178E31'>verde<n>.",
  25.     text14 = "<font size='15px'><font color='#000000'><b>Evite que o Cannon caia no gol para não perder <r>uma vida<n>.",
  26.     text15 = "pisos",
  27.     text18 = "<j>É necessário dois jogadores ou mais para iniciar a partida<n>"
  28. }
  29. lang.en = {
  30.     text1 = "<p align='center'><font size='14px'><font color='#000000'><b>The game will start in",
  31.     text2 = "<p align='center'><font size='15px'><a href='event:p'>Press to participate",
  32.     text3 = "<p align='center'><font size='12px'>Players in game:",
  33.     text4 = "<p align='center'><font size='15px'>Participating",
  34.     text5 = "<p align='center'><font size='13px'>Maximum player capacity reached.",
  35.     text6 = "<p align='center'><font size='20px'><font face='soopafresh'><bv>Deadfender<n> (Beta)<br><br><font face='Verdana'><font size='12px'>Go to:<br><br><font color='#FFE300'>Instructions</font> | <a href='event:cmd'>Commands</a>",
  36.     text7 = "<font size='15px'><bv>How to play<n>:<font size='12px'><br><br><br>1- Prevent the cannon from reaching the goal by placing the grounds (you can spawn them by clicking on the screen);<br><br>2- The cannon will spawn on the green area. Use the green area to place the grounds by clicking on the screen and prevent the cannon from reaching the goal.;<br><br>3- You'll be able to place 2 or 3 grounds. It depends on the current round.",      
  37.     text8 = "<p align='center'><font size='20px'><font face='soopafresh'><bv>Deadfender<n> (Beta)<br><br><font face='Verdana'><font size='12px'>Go to:<br><br><a href='event:ajuda'>Instructions</a> | <font color='#FFE300'>Commands</font>",
  38.     text9 = "<font size='15px'><bv>Commands<n>: -- <rose>*<n> -> Room admin commands --<font size='12px'><br><br><br><j>!Resettimer<n> <rose>*<n> - The time to start is reset<br><j>!lang [BR/EN]<n> - Change the game language.<br><br><br><br><br><br>Idea programmer: Refletz#6472 (Soristl)<br><br>Thanks to everyone who collaborated in some way to create this script ;)",
  39.     text10 = "<p align='center'><font size='12px'><a href='event:vida'>Players lives ",
  40.     text11 = "<p align='center'><font size='15px'><font color='#D30A0A'>Read the help to:<br>Instructions | Commands",
  41.     text12 = "<p align='center'><font size='12px'>In this round you’ll be able to spawn",
  42.     text13 = "<font size='15px'><font color='#000000'><b>Spawn the grounds by clicking in the <font color='#178E31'>green area.",
  43.     text14 = "<font size='15px'><font color='#000000'><b>Prevent the cannon from reaching the goal to avoid losing <r>one life<n>.",
  44.     text15 = "grounds",
  45.     text18 = "<j>Two or more players are required to start the game<n>"
  46. }
  47.  
  48. if tfm.get.room.community == "br" then
  49.         trad = lang.br
  50.     else
  51.         trad = lang.en
  52. end
  53.  
  54. for name, data in pairs(tfm.get.room.playerList) do
  55.     mice[name] = {v = name, tr = trad}
  56.     table.insert(mice, mice[name])
  57. end
  58. function iniciar()
  59.     tfm.exec.disableAutoShaman() tfm.exec.newGame('<C><P F="8" L="2131" H="600" /><Z><S><S L="2131" X="1065" H="40" Y="580" T="10" P="0,0,0.3,0,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="6a7495" X="-5" Y="300" T="12" H="610" /><S L="10" o="6a7495" X="2135" H="610" Y="300" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,90,0,0,0" L="10" o="6a7495" H="2131" Y="-1" T="12" X="1065" /><S P="0,0,0.3,0.2,0,0,0,0" Y="0" L="10" X="0" c="4" i="322,450,../godspaw/img/renard/anim-1-3.png" T="14" H="10" /><S P="0,0,0.3,0.2,0,0,0,0" Y="0" L="10" X="0" c="4" i="100,200,17429228e27.png" T="14" H="10" /></S><D><DS Y="479" X="213" /></D><O /></Z></C>')
  60.     tfm.exec.disableAutoNewGame()
  61.     tfm.exec.disableAutoScore (true)
  62.     tfm.exec.disableAutoTimeLeft (true)
  63.     tfm.exec.disableAfkDeath (true)
  64.     tfm.exec.disableMortCommand (true)
  65.     tfm.exec.disablePhysicalConsumables (true)
  66.     removeText()
  67.     ui.removeTextArea(3001)
  68.     ui.removeTextArea(3002)
  69.     tabela = {}
  70.     for tv = 1, #mice do
  71.         ui.addTextArea(1, mice[tv].tr.text2, mice[tv].v, 250, 370, 300, 25, 0x0e232b, 0x171717, 1, true)
  72.         ui.addTextArea(2, mice[tv].tr.text3.." "..#tabela.."/8", mice[tv].v, 30, 370, 200, 25, 0x0e232b, 0x171717, 1, true)
  73.         ui.addTextArea(18, mice[tv].tr.text13, mice[tv].v, 989, 350, 190, 90, 0x242424, 0xFFFFFF, 0, false)
  74.         ui.addTextArea(19, mice[tv].tr.text14, mice[tv].v, 1745, 348, 190, 92, 0x242424, 0xFFFFFF, 0, false)
  75.         if tt == 0 then
  76.             ui.addTextArea(5001, "", mice[tv].v, 0, 0, 800, 400, 0x161616, 0x161616, 0.8, true)
  77.             ui.addPopup(0, 1, mice[tv].tr.text11, mice[tv].v, 300, 150, 250, true)
  78.         end
  79.     end
  80.     tabela1 = {}
  81.     objectList = {}
  82.     fim = false
  83.     inGame = false
  84.     spec = {}
  85.     players = {}
  86.     player1 = "a"
  87.     player2 = "b"
  88.     player3 = "c"
  89.     player4 = "d"
  90.     player5 = "e"
  91.     player6 = "f"
  92.     player7 = "g"
  93.     player8 = "h"
  94.     lifer = 0
  95.     lifeb = 0
  96.     lifey = 0
  97.     lifeg = 0
  98.     lifeo = 0
  99.     lifero = 0
  100.     lifep = 0
  101.     lifec = 0
  102.     cm = 0
  103.     tt = 1
  104.     time = os.time() + 25000
  105.     modo = "espera"
  106.     ui.addTextArea(4000, "<p align='center'><font size='15px'><a href='event:ajuda'>?", nil, 5, 25, 20, 20, 0x0e232b, 0x171717, 1, true)
  107.     --system.bindMouse (admin, true)
  108. end
  109. function eventTextAreaCallback(tI, name, c)
  110.     if c == "p" and #tabela <= 8 then
  111.         t = false
  112.         for i = 1, #tabela, 1 do
  113.             if tabela[i] == name then
  114.                 t = true
  115.             end
  116.         end
  117.         if t == false then
  118.             table.insert(tabela, name)
  119.             ui.addTextArea(1, mice[name].tr.text4, mice[name].v, 250, 370, 300, 25, 0x0e232b, 0x171717, 1, true)
  120.             for pf = 1, #mice do
  121.                 ui.addTextArea(2, mice[pf].tr.text3.." "..#tabela.."/8", mice[pf].v, 30, 370, 200, 25, 0x0e232b, 0x171717, 1, true)
  122.             end
  123.         end
  124.         if #tabela == 8 then
  125.             for vt = 1, #mice do
  126.                 ui.addTextArea(4, mice[vt].tr.text5, nil, 250, 370, 300, 25, 0x0e232b, 0x171717, 1, false)
  127.             end
  128.             for tb = 1, #tabela do
  129.                 ui.removeTextArea(4, tabela[tb])
  130.             end
  131.         end
  132.     end
  133.     if c == "ajuda" then
  134.         repita(name)
  135.     end
  136.     if c == "fecha" then
  137.         ui.removeTextArea(4001, name)
  138.         ui.removeTextArea(4002, name)
  139.         ui.removeTextArea(4003, name)
  140.     end
  141.     if c == "cmd" then
  142.         ui.addTextArea(4001, mice[name].tr.text8, mice[name].v, 100, 50, 600, 100, 0x0e232b, 0x171717, 1, true)
  143.         ui.addTextArea(4002, mice[name].tr.text9, mice[name].v, 100, 150, 600, 200, 0x0e232b, 0x171717, 1, true)
  144.         ui.addTextArea(4003, "<p align='center'><font size='15px'><a href='event:fecha'><r>X<n>", name, 650, 60, 30, 20, 0x0e232b, 0x171717, 1, true)
  145.     end
  146.     if c == "vida" then
  147.         lang.br.text16 = "<p align='center'><font size='15px'><font face='soopafresh'>Vida dos jogadores</font><p align='left'><font size='14px'><font face='arial'><br><br>Jogador: <r>"..tabela1[1].."<n> | Vida: "..lifer.."<br>Jogador: <bv>"..tabela1[2].."<n> | Vida: "..lifeb.."<br>Jogador: <j>"..tabela1[3].."<n> | Vida: "..lifey.." <br>Jogador: <vp>"..tabela1[4].."<n> | Vida: "..lifeg.." <br>Jogador: <ce>"..tabela1[5].."<n> | Vida "..lifeo.." <br>Jogador: <rose>"..tabela1[6].."<n> | Vida: "..lifero.." <br>Jogador: <vi>"..tabela1[7].."<n> | Vida: "..lifep.." <br>Jogador: <CH>"..tabela1[8].."<n> | Vida: "..lifec..""
  148.         lang.en.text16 = "<p align='center'><font size='15px'><font face='soopafresh'>Players' lives</font><p align='left'><font size='14px'><font face='arial'><br><br>Player: <r>"..tabela1[1].."<n> | Life: "..lifer.."<br>Player: <bv>"..tabela1[2].."<n> | Life: "..lifeb.."<br>Player: <j>"..tabela1[3].."<n> | Life: "..lifey.." <br>Player: <vp>"..tabela1[4].."<n> | Life: "..lifeg.." <br>Player: <ce>"..tabela1[5].."<n> | Life: "..lifeo.." <br>Player: <rose>"..tabela1[6].."<n> | Life: "..lifero.." <br>Player: <vi>"..tabela1[7].."<n> | Life: "..lifep.." <br>Player: <CH>"..tabela1[8].."<n> | Life: "..lifec..""
  149.         ui.addTextArea(3001, mice[name].tr.text16, name, 264, 114, 400, 200, 0x0e232b, 0x171717, 1, true)
  150.         ui.addTextArea(3002, "<p align='center'><font size='15px'><a href='event:fecha1'><r>X<n>", name, 620, 124, 30, 20, 0x0e232b, 0x171717, 1, true)
  151.     end
  152.     if c == "fecha1" then
  153.         ui.removeTextArea(3001, name)
  154.         ui.removeTextArea(3002, name)
  155.     end
  156. end
  157. function eventLoop(current, remaining)
  158.     if modo == "espera" then
  159.         local x = math.ceil((time - os.time())/1000)
  160.         c =  string.format("%d", x)
  161.         for vt = 1, #mice do
  162.             ui.addTextArea(0, mice[vt].tr.text1.." "..c.."s", mice[vt].name, 110, 390, 220, 25, 0x0e232b, 0x171717, 0, false)
  163.         end
  164.         if x == 0 then
  165.             if #tabela >= 2 then
  166.                 removeText()
  167.                 maps()
  168.                 if cm == 0 then
  169.                     cm = cm + 1
  170.                     checkPlayers()
  171.                 end
  172.             else
  173.                 time = os.time() + 15000
  174.                 tfm.exec.chatMessage (trad.text18, nil)
  175.             end
  176.         end
  177.     end
  178.     if modo == "espera2" then
  179.         for player1, data in pairs(tfm.get.room.playerList) do
  180.             table.insert(spec, player1)
  181.         end
  182.         for element1 = 1, #players do
  183.             for element2 = 1, #spec do
  184.                 if players[element1] == spec[element2] then
  185.                     table.remove(spec, element2)
  186.                 end
  187.             end
  188.         end
  189.         for element3 = 1, #spec do
  190.             tfm.exec.killPlayer(spec[element3])
  191.         end
  192.         teleportPlayers()
  193.         modo = "espera1"
  194.         popup()
  195.     end
  196.     if modo == "espera1" then
  197.         removeText()
  198.         conts()
  199.         maxspawn = math.random(2,3)
  200.         for fr = 1, #mice do
  201.             ui.addTextArea(7, mice[fr].tr.text12.." "..maxspawn.." "..mice[fr].tr.text15.."", mice[fr].v, 240, 56, 340, 25, 0x0e232b, 0x171717, 1, true)
  202.         end
  203.         attLife(nil)
  204.         time = os.time() + 15000
  205.         portais()
  206.         checkl()
  207.         modo = "iniciar"
  208.     end
  209.     if modo == "iniciar" then
  210.         local x1 = math.ceil((time - os.time())/1000)
  211.         c = string.format("%d", x1)
  212.         ui.setMapName ("<rose>Cannon Spawn in "..c.."s")
  213.         if x1 == 0 then
  214.             system.bindMouse (player1, false)
  215.             system.bindMouse (player2, false)
  216.             system.bindMouse (player3, false)
  217.             system.bindMouse (player4, false)
  218.             system.bindMouse (player5, false)
  219.             system.bindMouse (player6, false)
  220.             system.bindMouse (player7, false)
  221.             system.bindMouse (player8, false)
  222.             for gf = 3, 6 do
  223.                 ui.removeTextArea(gf)
  224.             end
  225.             for gf1 = 8, 11 do
  226.                 ui.removeTextArea(gf1)
  227.             end
  228.             spawnCannon()
  229.                 time = os.time() + 10000
  230.             modo = "definicao"
  231.         end
  232.     end
  233.     if modo == "definicao" then
  234.         local x2 = math.ceil((time - os.time())/1000)
  235.         c1 = string.format("%d", x2)
  236.         if x2 == 0 then
  237.             spawnT()
  238.             modo = "espera3"
  239.             time = os.time() + 5000
  240.             ui.setMapName ("<rose>Processing...")
  241.         end
  242.     end
  243.     if modo == "espera3" then
  244.         local x10 = math.ceil((time - os.time())/1000)
  245.         if x10 == 0 then
  246.             collect()
  247.             condi = 0
  248.             condi2 = 0
  249.             objcoords()
  250.             condi = condi + 1
  251.             if condi2 == 1 then
  252.                 ui.removeTextArea(2)
  253.                 ui.removeTextArea(5)
  254.                 ui.removeTextArea(6)
  255.                 checkwin()
  256.             end
  257.         end
  258.     end
  259.     if modo == "limpar" then
  260.         limpar()
  261.         modo = "espera1"
  262.     end
  263.     if modo == "vitoria" then
  264.         local x3 = math.ceil((time - os.time())/1000)
  265.         c = string.format("%d", x3)
  266.         if twin[1] == player1 then
  267.             ui.addTextArea(5000, "<p align='center'><font size='30px'><textformat leading='150'><br><r>"..twin[1].."<n> won!!!", nil, 0, 0, 800, 400, 0x161616, 0x161616, 0.8, true)
  268.         end
  269.         if twin[1] == player2 then
  270.             ui.addTextArea(5000, "<p align='center'><font size='30px'><textformat leading='150'><br><bv>"..twin[1].."<n> won!!!", nil, 0, 0, 800, 400, 0x161616, 0x161616, 0.8, true)
  271.         end
  272.         if twin[1] == player3 then
  273.             ui.addTextArea(5000, "<p align='center'><font size='30px'><textformat leading='150'><br><j>"..twin[1].."<n> won!!!", nil, 0, 0, 800, 400, 0x161616, 0x161616, 0.8, true)
  274.         end
  275.         if twin[1] == player4 then
  276.             ui.addTextArea(5000, "<p align='center'><font size='30px'><textformat leading='150'><br><vp>"..twin[1].."<n> won!!!", nil, 0, 0, 800, 400, 0x161616, 0x161616, 0.8, true)
  277.         end
  278.         if twin[1] == player5 then
  279.             ui.addTextArea(5000, "<p align='center'><font size='30px'><textformat leading='150'><br><ce>"..twin[1].."<n> won!!!", nil, 0, 0, 800, 400, 0x161616, 0x161616, 0.8, true)
  280.         end
  281.         if twin[1] == player6 then
  282.             ui.addTextArea(5000, "<p align='center'><font size='30px'><textformat leading='150'><br><rose>"..twin[1].."<n> won!!!", nil, 0, 0, 800, 400, 0x161616, 0x161616, 0.8, true)
  283.         end
  284.         if twin[1] == player7 then
  285.             ui.addTextArea(5000, "<p align='center'><font size='30px'><textformat leading='150'><br><vi>"..twin[1].."<n> won!!!", nil, 0, 0, 800, 400, 0x161616, 0x161616, 0.8, true)
  286.         end
  287.         if twin[1] == player8 then
  288.             ui.addTextArea(5000, "<p align='center'><font size='30px'><textformat leading='150'><br><ch>"..twin[1].."<n> won!!!", nil, 0, 0, 800, 400, 0x161616, 0x161616, 0.8, true)
  289.         end
  290.         if x3 == 0 then
  291.             iniciar()
  292.         end
  293.     end
  294.     if modo == "empate" then
  295.         local x4 = math.ceil((time - os.time())/1000)
  296.         c = string.format("%d", x4)
  297.         ui.addTextArea(5000, "<p align='center'><font size='30px'><textformat leading='150'><br>Draw", nil, 0, 0, 800, 400, 0x161616, 0x161616, 0.8, true)
  298.         if x4 == 0 then
  299.             iniciar()
  300.         end
  301.     end
  302. end
  303. function eventMouse(jogador, x5, y5)
  304.     if jogador == admin then
  305.         --print("X: "..x5.." Y: "..y5.."")
  306.     end
  307.     if jogador == player1 then
  308.         checkcoordsofclick1(x5, y5, id1, 118, 244)
  309.     end
  310.     if jogador == player2 then
  311.         checkcoordsofclick2(x5, y5, id2, 560, 686)
  312.     end
  313.     if jogador == player3 then
  314.         checkcoordsofclick3(x5, y5, id3, 1002, 1128)
  315.     end
  316.     if jogador == player4 then
  317.         checkcoordsofclick4(x5, y5, id4, 1444, 1570)
  318.     end
  319.     if jogador == player5 then
  320.         checkcoordsofclick5(x5, y5, id5, 1886, 2012)
  321.     end
  322.     if jogador == player6 then
  323.         checkcoordsofclick6(x5, y5, id6, 2328, 2454)
  324.     end
  325.     if jogador == player7 then
  326.         checkcoordsofclick7(x5, y5, id7, 2770, 2896)
  327.     end
  328.     if jogador == player8 then
  329.         checkcoordsofclick8(x5, y5, id8, 3212, 3338)
  330.     end
  331. end
  332.  
  333. function checkcoordsofclick1(x, y, id, InitBorderSpawn, EndBorderSpawn)
  334.     if cont >= 0 and cont < maxspawn then
  335.         if x >= InitBorderSpawn and x <= EndBorderSpawn then
  336.             if y >= 299 and y <= 362 then
  337.                 cont = cont + 1
  338.                 id1 = id1 + 1
  339.                 CheckCoordAndIdofGround(x, y, id)
  340.             end
  341.         end
  342.     end
  343. end
  344.  
  345.  
  346. function checkcoordsofclick2(x, y, id, InitBorderSpawn, EndBorderSpawn)
  347.     if cont2 >= 0 and cont2 < maxspawn then
  348.         if x >= InitBorderSpawn and x <= EndBorderSpawn then
  349.             if y >= 299 and y <= 362 then
  350.                 cont2 = cont2 + 1
  351.                 id2 = id2 + 1
  352.                 CheckCoordAndIdofGround(x, y, id)
  353.             end
  354.         end
  355.     end
  356. end
  357.  
  358. function checkcoordsofclick3(x, y, id, InitBorderSpawn, EndBorderSpawn)
  359.     if cont3 >= 0 and cont3 < maxspawn then
  360.         if x >= InitBorderSpawn and x <= EndBorderSpawn then
  361.             if y >= 299 and y <= 362 then
  362.                 cont3 = cont3 + 1
  363.                 id3 = id3 + 1
  364.                 CheckCoordAndIdofGround(x, y, id)
  365.             end
  366.         end
  367.     end
  368. end
  369.  
  370. function checkcoordsofclick4(x, y, id, InitBorderSpawn, EndBorderSpawn)
  371.     if cont4 >= 0 and cont4 < maxspawn then
  372.         if x >= InitBorderSpawn and x <= EndBorderSpawn then
  373.             if y >= 299 and y <= 362 then
  374.                 cont4 = cont4 + 1
  375.                 id4 = id4 + 1
  376.                 CheckCoordAndIdofGround(x, y, id)
  377.             end
  378.         end
  379.     end
  380. end
  381.  
  382. function checkcoordsofclick5(x, y, id, InitBorderSpawn, EndBorderSpawn)
  383.     if cont5 >= 0 and cont5 < maxspawn then
  384.         if x >= InitBorderSpawn and x <= EndBorderSpawn then
  385.             if y >= 299 and y <= 362 then
  386.                 cont5 = cont5 + 1
  387.                 id5 = id5 + 1
  388.                 CheckCoordAndIdofGround(x, y, id)
  389.             end
  390.         end
  391.     end
  392. end
  393.  
  394. function checkcoordsofclick6(x, y, id, InitBorderSpawn, EndBorderSpawn)
  395.     if cont6 >= 0 and cont6 < maxspawn then
  396.         if x >= InitBorderSpawn and x <= EndBorderSpawn then
  397.             if y >= 299 and y <= 362 then
  398.                 cont6 = cont6 + 1
  399.                 id6 = id6 + 1
  400.                 CheckCoordAndIdofGround(x, y, id)
  401.             end
  402.         end
  403.     end
  404. end
  405.  
  406. function checkcoordsofclick7(x, y, id, InitBorderSpawn, EndBorderSpawn)
  407.     if cont7 >= 0 and cont7 < maxspawn then
  408.         if x >= InitBorderSpawn and x <= EndBorderSpawn then
  409.             if y >= 299 and y <= 362 then
  410.                 cont7 = cont7 + 1
  411.                 id7 = id7 + 1
  412.                 CheckCoordAndIdofGround(x, y, id)
  413.             end
  414.         end
  415.     end
  416. end
  417.  
  418. function checkcoordsofclick8(x, y, id, InitBorderSpawn, EndBorderSpawn)
  419.     if cont8 >= 0 and cont8 < maxspawn then
  420.         if x >= InitBorderSpawn and x <= EndBorderSpawn then
  421.             if y >= 299 and y <= 362 then
  422.                 cont8 = cont8 + 1
  423.                 id8 = id8 + 1
  424.                 CheckCoordAndIdofGround(x, y, id)
  425.             end
  426.         end
  427.     end
  428. end
  429. tc = {8, 9, 10, 3, 1}
  430. td = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
  431. te = {3, 11, 2, 4, 8}
  432.  
  433. function CheckCoordAndIdofGround(x, y, id)
  434.     if y <= 316 then
  435.         grounds(id, x, y, tc)
  436.     elseif y >= 317 and y < 347 then
  437.         grounds(id, x, y, td)
  438.     elseif y >= 347 then
  439.         grounds(id, x, y, te)
  440.     end
  441. end
  442.  
  443. function grounds(id, x, y, arg2)
  444.     t = {10, 20}
  445.     ang = {0, 30, 45, 60, -30, -45}
  446.     arg1 = arg2[math.random(#arg2)]
  447.     if arg1 == 0 then
  448.     tfm.exec.addPhysicObject(id, x, y, {type = arg1, color = math.random(0xFFFFFF), width = t[math.random(#t)], height = 2, friction = .2, restitution = .0, miceCollision = true, angle = ang[math.random(#ang)], groundCollision = true})
  449.     elseif arg1 == 1 then
  450.         tfm.exec.addPhysicObject(id, x, y, {type = arg1, color = math.random(0xFFFFFF), width = t[math.random(#t)], height = 2, friction = .0, restitution = .10, miceCollision = true, angle = ang[math.random(#ang)], groundCollision = true})
  451.     elseif arg1 == 2 then
  452.         tfm.exec.addPhysicObject(id, x, y, {type = arg1, color = math.random(0xFFFFFF), width = t[math.random(#t)], height = 2, friction = 0, restitution = 1.2, miceCollision = true, angle = ang[math.random(#ang)], groundCollision = true})
  453.     elseif arg1 == 3 then
  454.         tfm.exec.addPhysicObject(id, x, y, {type = arg1, color = math.random(0xFFFFFF), width = t[math.random(#t)], height = 2, friction = 0, restitution = 5.0, miceCollision = true, angle = ang[math.random(#ang)], groundCollision = true})
  455.     elseif arg1 == 4 then
  456.         tfm.exec.addPhysicObject(id, x, y, {type = arg1, color = math.random(0xFFFFFF), width = t[math.random(#t)], height = 2, friction = 30, restitution = 0.2, miceCollision = true, angle = ang[math.random(#ang)], groundCollision = true})
  457.     elseif arg1 == 5 then
  458.         tfm.exec.addPhysicObject(id, x, y, {type = arg1, color = math.random(0xFFFFFF), width = t[math.random(#t)], height = 2, friction = 20, restitution = .1, miceCollision = true, angle = ang[math.random(#ang)], groundCollision = true})
  459.     elseif arg1 == 6 then
  460.         tfm.exec.addPhysicObject(id, x, y, {type = arg1, color = math.random(0xFFFFFF), width = t[math.random(#t)], height = 2, friction = 20, restitution = .1, miceCollision = true, angle = ang[math.random(#ang)], groundCollision = true})
  461.     elseif arg1 == 7 then
  462.         tfm.exec.addPhysicObject(id, x, y, {type = arg1, color = math.random(0xFFFFFF), width = t[math.random(#t)], height = 2, friction = 10, restitution = .0, miceCollision = true, angle = ang[math.random(#ang)], groundCollision = true})
  463.     elseif arg1 == 8 then
  464.         tfm.exec.addPhysicObject(id, x, y, {type = arg1, color = math.random(0xFFFFFF), width = t[math.random(#t)], height = 2, friction = 20, restitution = .1, miceCollision = false, angle = ang[math.random(#ang)], groundCollision = false})
  465.     elseif arg1 == 9 then
  466.         tfm.exec.addPhysicObject(id, x, y, {type = arg1, color = math.random(0xFFFFFF), width = t[math.random(#t)], height = 2, friction = 20, restitution = .1, miceCollision = false, angle = ang[math.random(#ang)], groundCollision = false})
  467.     elseif arg1 == 10 then
  468.         tfm.exec.addPhysicObject(id, x, y, {type = 9, color = math.random(0xFFFFFF), width = 40, height = 40, friction = 20, restitution = .1, miceCollision = false, angle = ang[math.random(#ang)], groundCollision = false})
  469.     elseif arg1 == 11 then
  470.         tfm.exec.addPhysicObject(id, x, y, {type = 13, color = 0xAA65C7, width = 10, height = 10, friction = .0, restitution = 1.2, miceCollision = false, angle = ang[math.random(#ang)], groundCollision = true})
  471.     end
  472. end
  473.  
  474. function checkwin()
  475.     if lifer <= 0 then
  476.         for el = 1, #twin, 1 do
  477.             if twin[el] == player1 then
  478.                 table.remove(twin, el)
  479.                 player1 = "a"
  480.             end
  481.         end
  482.     end
  483.     if lifeb <= 0 then
  484.         for ele = 1, #twin, 1 do
  485.             if twin[ele] == player2 then
  486.                 table.remove(twin, ele)
  487.                 player2 = "b"
  488.             end
  489.         end
  490.     end
  491.     if lifey <= 0 then
  492.         for elee = 1, #twin, 1 do
  493.             if twin[elee] == player3 then
  494.                 table.remove(twin, elee)
  495.                 player3 = "c"
  496.             end
  497.         end
  498.     end
  499.     if lifeg <= 0 then
  500.         for bk = 1, #twin, 1 do
  501.             if twin[bk] == player4 then
  502.                 table.remove(twin, bk)
  503.                 player4 = "d"
  504.             end
  505.         end
  506.     end
  507.     if lifeo <= 0 then
  508.         for bk1 = 1, #twin, 1 do
  509.             if twin[bk1] == player5 then
  510.                 table.remove(twin, bk1)
  511.                 player5 = "e"
  512.             end
  513.         end
  514.     end
  515.     if lifero <= 0 then
  516.         for bk2 = 1, #twin, 1 do
  517.             if twin[bk2] == player6 then
  518.                 table.remove(twin, bk2)
  519.                 player6 = "f"
  520.             end
  521.         end
  522.     end
  523.     if lifep <= 0 then
  524.         for bk3 = 1, #twin, 1 do
  525.             if twin[bk3] == player7 then
  526.                 table.remove(twin, bk3)
  527.                 player7 = "g"
  528.             end
  529.         end
  530.     end
  531.     if lifec <= 0 then
  532.         for bk4 = 1, #twin, 1 do
  533.             if twin[bk4] == player8 then
  534.                 table.remove(twin, bk4)
  535.                 player8 = "h"
  536.             end
  537.         end
  538.     end
  539.     if #twin == 1 then
  540.         inGame = false
  541.         modo = "vitoria"
  542.         time = os.time() + 5000
  543.         limpar()
  544.     end
  545.     if #twin == 0 then
  546.         inGame = false
  547.         modo = "empate"
  548.         time = os.time() + 5000
  549.         limpar()
  550.     end
  551.     if #twin > 1 then
  552.         modo = "limpar"
  553.     end
  554. end
  555.  
  556. function eventPlayerLeft(jogador)
  557.     if jogador == player1 then
  558.         lifer = 0
  559.         for p1 = 1, #twin, 1 do
  560.             if player1 == twin[p1] then
  561.                 table.remove(twin, p1)
  562.                 player1 = "a"
  563.                 table.insert(twin, 1, player1)
  564.             end
  565.         end
  566.         tw()
  567.     end
  568.     if jogador == player2 then
  569.         lifeb = 0
  570.         for p2 = 1, #twin, 1 do
  571.             if player2 == twin[p2] then
  572.                 table.remove(twin, p2)
  573.                 player2 = "b"
  574.                 table.insert(twin, 2, player2)
  575.             end
  576.         end
  577.         tw()
  578.     end
  579.     if jogador == player3 then
  580.         lifey = 0
  581.         for p3 = 1, #twin, 1 do
  582.             if player3 == twin[p3] then
  583.                 table.remove(twin, p3)
  584.                 player3 = "c"
  585.                 table.insert(twin, 3, player3)
  586.             end
  587.         end
  588.         tw()
  589.     end
  590.     if jogador == player4 then
  591.         lifeg = 0
  592.         for p4 = 1, #twin, 1 do
  593.             if player4 == twin[p4] then
  594.                 table.remove(twin, p4)
  595.                 player4 = "d"
  596.                 table.insert(twin, 4, player4)
  597.             end
  598.         end
  599.         tw()
  600.     end
  601.     if jogador == player5 then
  602.         lifeo = 0
  603.         for p5 = 1, #twin, 1 do
  604.             if player5 == twin[p5] then
  605.                 table.remove(twin, p5)
  606.                 player5 = "e"
  607.                 table.insert(twin, 5, player5)
  608.             end
  609.         end
  610.         tw()
  611.     end
  612.     if jogador == player6 then
  613.         lifero = 0
  614.         for p6 = 1, #twin, 1 do
  615.             if player6 == twin[p6] then
  616.                 table.remove(twin, p6)
  617.                 player6 = "f"
  618.                 table.insert(twin, 6, player6)
  619.             end
  620.         end
  621.         tw()
  622.     end
  623.     if jogador == player7 then
  624.         lifep = 0
  625.         for p7 = 1, #twin, 1 do
  626.             if player7 == twin[p7] then
  627.                 table.remove(twin, p7)
  628.                 player7 = "g"
  629.                 table.insert(twin, 7, player7)
  630.             end
  631.         end
  632.         tw()
  633.     end
  634.     if jogador == player8 then
  635.         lifec = 0
  636.         for p8 = 1, #twin, 1 do
  637.             if player8 == twin[p8] then
  638.                 table.remove(twin, p8)
  639.                 player8 = "h"
  640.                 table.insert(twin, 8, player8)
  641.             end
  642.         end
  643.         tw()
  644.     end
  645.     if modo == "espera" then
  646.         for sair = 1, #tabela, 1 do
  647.             if tabela[sair].v == jogador then
  648.                 table.remove(tabela, sair)
  649.                 for tt = 1, #mice do
  650.                     ui.addTextArea(2, mice[tt].tr.text3.." "..#tabela.."/8", mice[tt].name, 30, 370, 200, 25, 0x0e232b, 0x171717, 1, true)
  651.                 end
  652.                 if #tabela < 8 then
  653.                     for tts = 1, #mice do
  654.                         ui.addTextArea(4, mice[tts].tr.text2, mice[tts].name, 250, 370, 300, 25, 0x0e232b, 0x171717, 1, true)
  655.                     end
  656.                     for vvv = 1, #tabela do
  657.                         ui.removeTextArea(4, tabela[vvv])
  658.                     end
  659.                 end
  660.             end
  661.         end
  662.     end
  663. end
  664. function tw()
  665.     if #twin <= 2 then
  666.         checkwin()
  667.     end
  668. end
  669. function eventNewPlayer(jogador)
  670.     xg = false
  671.     for vv = 1, #mice do
  672.         if mice[vv].v == jogador then
  673.             xg = true
  674.         end
  675.     end
  676.     if xg == false then
  677.         mice[jogador] = {v = jogador, tr = trad}   
  678.         table.insert(mice, mice[jogador])
  679.     end
  680.     ui.addTextArea(4000, "<p align='center'><font size='15px'><a href='event:ajuda'>?", jogador, 5, 25, 20, 20, 0x0e232b, 0x171717, 1, true)
  681.     if modo == "espera" then
  682.         tfm.exec.respawnPlayer(jogador)
  683.         for vk = 1, #mice do
  684.             if mice[vk].v == jogador then
  685.                 ui.addTextArea(2, mice[vk].tr.text3.." "..#tabela.."/8", jogador, 30, 370, 200, 25, 0x0e232b, 0x171717, 1, true)
  686.             end
  687.         end
  688.         ui.addTextArea(18, mice[jogador].tr.text13, mice[jogador].v, 989, 350, 190, 90, 0x242424, 0xFFFFFF, 0, false)
  689.         ui.addTextArea(19, mice[jogador].tr.text14, mice[jogador].v, 1745, 348, 190, 92, 0x242424, 0xFFFFFF, 0, false)
  690.         lt = false
  691.         if lt == false and #tabela < 8 then
  692.             for vs = 1, #mice do
  693.                 if mice[vs].v == jogador then
  694.                     ui.addTextArea(1, mice[vs].tr.text2, jogador, 250, 370, 300, 25, 0x0e232b, 0x171717, 1, true)
  695.                 end
  696.             end
  697.         else
  698.             for gx = 1, #mice do
  699.                 if mice[gx].v == jogador then
  700.                     ui.addTextArea(1, mice[gx].tr.text5, mice[gx].v, 250, 370, 300, 25, 0x0e232b, 0x171717, 1, true)
  701.                 end
  702.             end
  703.         end
  704.     end
  705.     if modo ~= "espera" then
  706.         for lg = 1, #mice do
  707.             if mice[lg].v == jogador then
  708.                 ui.addTextArea(7, mice[lg].tr.text12.." "..maxspawn.." "..mice[lg].tr.text15.."", jogador, 240, 56, 340, 25, 0x0e232b, 0x171717, 1, true)
  709.             end
  710.         end
  711.         attLife(jogador)
  712.         spawn()
  713.     end
  714.     if inGame == true then
  715.         ui.addTextArea(3000, mice[jogador].tr.text10, mice[jogador].v, 650, 34, 145, 20, 0x0e232b, 0x171717, 1, true)
  716.     end
  717.     ui.addTextArea(5001, "", jogador, 0, 0, 800, 400, 0x161616, 0x161616, 0.8, true)
  718.     ui.addPopup(0, 1, mice[jogador].tr.text11, jogador, 300, 150, 250, true)
  719. end
  720.  
  721. function popup()
  722.     times = {"<font color='#D00D0D'>Red</font>", "<font color='#1C59D9'>Blue</font>", "<font color='#FFE300'>Yellow</font>", "<font color='#19C52E'>Green</font>", "<font color='#FF8300'>Orange</font>", "<font color='#FF00F6'>Rose</font>", "<font color='#9100FF'>Purple</font>", "<font color='#00F3F3'>Cyan</font>"}
  723.     for tt = 1, #players do
  724.         player = players[tt]
  725.         text = times[tt]
  726.         lang.br.text17 = "<font size='12px'>Você é do time "..text..", <b>você deve proteger seu gol spawnando pisos na area <font color='#19C52E'>Verde</font> através do <font color='#19C52E'>click do mouse</font>.</b><br>o último a sobreviver vence, boa sorte!!!</font>"
  727.         lang.en.text17 = "<font size='12px'>You are the "..text.." team, <b>you must protect your goal placing grounds in the <font color='#19C52E'>green</font> area  by <font color='#19C52E'> pressing the left mouse button</font>.</b><br>the last survivor wins the game, good luck!!!</font>"
  728.         checkSomePlayers(player)
  729.         ui.addPopup(2, 0, mice[elementIndex].tr.text17, player, 200, 200, 300, true)
  730.     end
  731. end
  732.  
  733. function checkSomePlayers(player)
  734.     for vi = 1, #mice do
  735.         if player == mice[vi].v then
  736.             elementIndex = vi
  737.         end
  738.     end
  739. end
  740.  
  741. function eventChatCommand(name, message)
  742.     if (message:sub(0,10) == "resettimer") then
  743.         if admins[name] then
  744.             if modo == "espera" then
  745.                 time = os.time() + 15000
  746.             end
  747.         end
  748.     end
  749.     if message:sub(1,4)=="lang" then
  750.         v = string.lower(message:sub(6,7))
  751.         if lang[v] then
  752.             if v == "en" then
  753.                 mice[name].tr = lang.en
  754.                 att(name)
  755.             elseif v == "br" then
  756.                 mice[name].tr = lang.br
  757.                 att(name)
  758.             end
  759.         end
  760.     end
  761. end
  762.  
  763.  
  764. function att(jogador)
  765.     if modo == "espera" then
  766.         for vp = 1, #mice do
  767.             if mice[vp].v == jogador then
  768.                 ui.addTextArea(2, mice[vp].tr.text3.." "..#tabela.."/8", jogador, 30, 370, 200, 25, 0x0e232b, 0x171717, 1, true)
  769.             end
  770.         end
  771.         ui.addTextArea(18, mice[jogador].tr.text13, jogador, 989, 350, 190, 90, 0x242424, 0xFFFFFF, 0, false)
  772.         ui.addTextArea(19, mice[jogador].tr.text14, jogador, 1745, 348, 190, 92, 0x242424, 0xFFFFFF, 0, false)
  773.         t = false
  774.         for i = 1, #tabela, 1 do
  775.             if tabela[i] == jogador then
  776.                 t = true
  777.                 if t == true then
  778.                     ui.addTextArea(1, mice[jogador].tr.text4, jogador, 250, 370, 300, 25, 0x0e232b, 0x171717, 1, true)
  779.                 end        
  780.             end
  781.         end
  782.         if t == false then
  783.             if #tabela < 8 then
  784.                 for pv = 1, #mice do
  785.                     if mice[pv].v == jogador then
  786.                         ui.addTextArea(1, mice[pv].tr.text2, mice[pv].v, 250, 370, 300, 25, 0x0e232b, 0x171717, 1, true)
  787.                     end
  788.                 end
  789.             else
  790.                 for vt = 1, #mice do
  791.                     ui.addTextArea(4, mice[vt].tr.text5, mice[vt].v, 250, 370, 300, 25, 0x0e232b, 0x171717, 1, true)
  792.                 end
  793.                 for tb = 1, #tabela do
  794.                     ui.removeTextArea(4, tabela[tb])
  795.                 end
  796.             end
  797.         end
  798.     end
  799.     if modo ~= "espera" then
  800.         ui.addTextArea(7, mice[jogador].tr.text12.." "..maxspawn.." "..mice[jogador].tr.text15.."", jogador, 240, 56, 340, 25, 0x0e232b, 0x171717, 1, true)
  801.         if inGame == true then
  802.             ui.addTextArea(3000, mice[jogador].tr.text10, jogador, 650, 34, 145, 20, 0x0e232b, 0x171717, 1, true)
  803.         end
  804.     end
  805. end
  806.  
  807. function eventPopupAnswer(popupID, name, answer)
  808.     if popupID == 0 then
  809.         if answer == "yes" then
  810.             ui.removeTextArea(5001, name)
  811.             repita(name)
  812.         end
  813.         if answer == "no" then
  814.             ui.removeTextArea(5001, name)
  815.         end
  816.     end
  817. end
  818. function checkPlayers()
  819.     if #tabela > 0 then
  820.         l = math.random(#tabela)
  821.         player1 = tabela[l]
  822.         table.remove(tabela, l)
  823.         lifer = 3
  824.         twin = {player1}
  825.         tabela1 = {player1, player2, player3, player4, player5, player6, player7, player8}
  826.         table.insert(players, player1)
  827.     end
  828.     if #tabela > 0 then
  829.         l = math.random(#tabela)
  830.         player2 = tabela[l]
  831.         table.remove(tabela, l)
  832.         twin = {player1, player2}
  833.         tabela1 = {player1, player2, player3, player4, player5, player6, player7, player8}
  834.         lifeb = 3
  835.         table.insert(players, player2)
  836.     end
  837.     if #tabela > 0 then
  838.         l = math.random(#tabela)
  839.         player3 = tabela[l]
  840.         table.remove(tabela, l)
  841.         twin = {player1, player2, player3}
  842.         tabela1 = {player1, player2, player3, player4, player5, player6, player7, player8}
  843.         table.insert(players, player3)
  844.         lifey = 3
  845.     end
  846.     if #tabela > 0 then
  847.         l = math.random(#tabela)
  848.         player4 = tabela[l]
  849.         table.remove(tabela, l)
  850.         twin = {player1, player2, player3, player4}
  851.         tabela1 = {player1, player2, player3, player4, player5, player6, player7, player8}
  852.         lifeg = 3
  853.         table.insert(players, player4)
  854.     end
  855.     if #tabela > 0 then
  856.         l = math.random(#tabela)
  857.         player5 = tabela[l]
  858.         table.remove(tabela, l)
  859.         twin = {player1, player2, player3, player4, player5}
  860.         tabela1 = {player1, player2, player3, player4, player5, player6, player7, player8}
  861.         lifeo = 3
  862.         table.insert(players, player5)
  863.     end
  864.     if #tabela > 0 then
  865.         l = math.random(#tabela)
  866.         player6 = tabela[l]
  867.         table.remove(tabela, l)
  868.         twin = {player1, player2, player3, player4, player5, player6}
  869.         tabela1 = {player1, player2, player3, player4, player5, player6, player7, player8}
  870.         lifero = 3
  871.         table.insert(players, player6)
  872.     end
  873.     if #tabela > 0 then
  874.         l = math.random(#tabela)
  875.         player7 = tabela[l]
  876.         table.remove(tabela, l)
  877.         twin = {player1, player2, player3, player4, player5, player6, player7}
  878.         tabela1 = {player1, player2, player3, player4, player5, player6, player7, player8}
  879.         lifep = 3
  880.         table.insert(players, player7)
  881.     end
  882.     if #tabela > 0 then
  883.         l = math.random(#tabela)
  884.         player8 = tabela[l]
  885.         table.remove(tabela, l)
  886.         twin = {player1, player2, player3, player4, player5, player6, player7, player8}
  887.         tabela1 = {player1, player2, player3, player4, player5, player6, player7, player8}
  888.         lifec = 3
  889.         table.insert(players, player8)
  890.     end
  891.     lang.br.text16 = "<p align='center'><font size='15px'><font face='soopafresh'>Vida dos jogadores</font><p align='left'><font size='14px'><font face='arial'><br><br>Jogador: <r>"..tabela1[1].."<n> | Vida: "..lifer.."<br>Jogador: <bv>"..tabela1[2].."<n> | Vida: "..lifeb.."<br>Jogador: <j>"..tabela1[3].."<n> | Vida: "..lifey.." <br>Jogador: <vp>"..tabela1[4].."<n> | Vida: "..lifeg.." <br>Jogador: <ce>"..tabela1[5].."<n> | Vida "..lifeo.." <br>Jogador: <rose>"..tabela1[6].."<n> | Vida: "..lifero.." <br>Jogador: <vi>"..tabela1[7].."<n> | Vida: "..lifep.." <br>Jogador: <CH>"..tabela1[8].."<n> | Vida: "..lifec..""
  892.     lang.en.text16 = "<p align='center'><font size='15px'><font face='soopafresh'>Players' lives</font><p align='left'><font size='14px'><font face='arial'><br><br>Player: <r>"..tabela1[1].."<n> | Life: "..lifer.."<br>Player: <bv>"..tabela1[2].."<n> | Life: "..lifeb.."<br>Player: <j>"..tabela1[3].."<n> | Life: "..lifey.." <br>Player: <vp>"..tabela1[4].."<n> | Life: "..lifeg.." <br>Player: <ce>"..tabela1[5].."<n> | Life: "..lifeo.." <br>Player: <rose>"..tabela1[6].."<n> | Life: "..lifero.." <br>Player: <vi>"..tabela1[7].."<n> | Life: "..lifep.." <br>Player: <CH>"..tabela1[8].."<n> | Life: "..lifec..""
  893.     modo = "espera2"
  894.     inGame = true
  895.     if inGame == true then
  896.         for pp = 1, #mice do
  897.             ui.addTextArea(3000, mice[pp].tr.text10, mice[pp].v, 650, 34, 145, 20, 0x0e232b, 0x171717, 1, true)
  898.         end
  899.     end
  900. end
  901. function conts()
  902.     if lifer > 0 then
  903.         system.bindMouse (player1, true)
  904.         cont = 0
  905.         id1 = 0
  906.     end
  907.     if lifeb > 0 then
  908.         system.bindMouse (player2, true)
  909.         cont2 = 0
  910.         id2 = 3
  911.     end
  912.     if lifey > 0 then
  913.         system.bindMouse (player3, true)
  914.         cont3 = 0
  915.         id3 = 6
  916.     end
  917.     if lifeg > 0 then
  918.         system.bindMouse (player4, true)
  919.         cont4 = 0
  920.         id4 = 9
  921.     end
  922.     if lifeo > 0 then
  923.         system.bindMouse (player5, true)
  924.         cont5 = 0
  925.         id5 = 12
  926.     end
  927.     if lifero > 0 then
  928.         system.bindMouse (player6, true)
  929.         cont6 = 0
  930.         id6 = 15
  931.     end
  932.     if lifep > 0 then
  933.         system.bindMouse (player7, true)
  934.         cont7 = 0
  935.         id7 = 18
  936.     end
  937.     if lifec > 0 then
  938.         system.bindMouse (player8, true)
  939.         cont8 = 0
  940.         id8 = 21
  941.     end
  942. end
  943.    
  944. function maps()
  945.     mapas = {'<C><P D="connexion/x_forteresse/7.jpg, 600, 0, 2;connexion/x_forteresse/7.jpg, 1200, 0, 1;connexion/x_forteresse/7.jpg, 1800, 0, 1;connexion/x_forteresse/7.jpg, 2400, 0, 1;connexion/x_forteresse/7.jpg, 3000, 0, 1" L="3463" /><Z><S><S L="3000" X="1244" H="10" Y="0" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="3000" H="10" X="2321" Y="0" T="0" P="0,0,0.3,0.2,0,0,0,0" /></S><D><DS Y="316" X="-190" /></D><O /></Z></C>',
  946.              '<C><P D="connexion/x_forteresse/10.jpg, 600, 0, 2;connexion/x_forteresse/10.jpg, 1200, 0, 1;connexion/x_forteresse/10.jpg, 1800, 0, 1;connexion/x_forteresse/10.jpg, 2400, 0, 1;connexion/x_forteresse/10.jpg, 3000, 0, 1" L="3463" /><Z><S><S L="10" o="d00d0d" X="-1" H="130" Y="205" T="12" P="0,0,0.3,0.2,-50,0,0,0" /><S P="0,0,0.3,0.2,90,0,0,0" L="10" o="d00d0d" H="800" Y="81" T="12" X="-241" /><S L="10" o="d00d0d" H="130" X="154" Y="141" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="1c59d9" X="598" Y="141" T="12" H="130" /><S L="10" o="d00d0d" X="354" H="130" Y="206" T="12" P="0,0,0.3,0.2,50,0,0,0" /><S P="0,0,0.3,0.2,-50,0,0,0" L="10" o="1c59d9" H="130" Y="206" T="12" X="446" /><S L="10" o="1c59d9" H="406" X="400" Y="81" T="12" P="0,0,0.3,0.2,90,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="d00d0d" X="201" Y="141" T="12" H="130" /><S L="10" o="ffe300" X="1042" H="130" Y="141" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,50,0,0,0" L="10" o="1c59d9" H="130" Y="206" T="12" X="799" /><S L="10" o="ffe300" H="130" X="892" Y="206" T="12" P="0,0,0.3,0.2,-50,0,0,0" /><S P="0,0,0.3,0.2,90,0,0,0" L="10" o="ffe300" X="844" Y="81" T="12" H="406" /><S L="10" o="1c59d9" X="645" H="130" Y="141" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="ffe300" H="130" N="" Y="141" T="12" X="1089" /><S L="10" o="ffe300" H="130" X="1239" Y="206" T="12" P="0,0,0.3,0.2,50,0,0,0" /><S P="0,0,0.3,0.2,-50,0,0,0" L="10" o="19c52e" X="1332" Y="206" T="12" H="130" /><S L="10" o="19c52e" X="1287" H="406" Y="81" T="12" P="0,0,0.3,0.2,90,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="19c52e" H="130" Y="141" T="12" X="1489" /><S L="10" o="19c52e" H="130" X="1533" Y="141" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,50,0,0,0" L="10" o="19c52e" X="1685" Y="206" T="12" H="130" /><S L="10" o="ff8300" X="1779" H="130" Y="206" T="12" P="0,0,0.3,0.2,-50,0,0,0" /><S P="0,0,0.3,0.2,90,0,0,0" L="10" o="ff8300" H="406" Y="81" T="12" X="1731" /><S L="10" o="ff8300" H="130" X="1931" Y="141" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="ff8300" X="1977" Y="141" T="12" H="130" /><S L="10" o="ff8300" X="2128" H="130" Y="206" T="12" P="0,0,0.3,0.2,50,0,0,0" /><S P="0,0,0.3,0.2,-50,0,0,0" L="10" o="ff00f6" H="130" Y="206" T="12" X="2223" /><S L="10" o="ff00f6" H="406" X="2175" Y="81" T="12" P="0,0,0.3,0.2,90,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="ff00f6" X="2375" Y="141" T="12" H="130" /><S L="10" o="ff00f6" X="2421" H="130" Y="141" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,50,0,0,0" L="10" o="ff00f6" H="130" Y="206" T="12" X="2576" /><S L="10" o="9100ff" H="130" X="2668" Y="206" T="12" P="0,0,0.3,0.2,-50,0,0,0" /><S P="0,0,0.3,0.2,90,0,0,0" L="10" o="9100ff" X="2619" Y="81" T="12" H="406" /><S L="10" o="9100ff" X="2819" H="130" Y="141" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="9100ff" H="130" Y="141" T="12" X="2865" /><S L="10" o="9100ff" H="130" X="3012" Y="206" T="12" P="0,0,0.3,0.2,50,0,0,0" /><S P="0,0,0.3,0.2,-50,0,0,0" L="10" o="f3f3" X="3104" Y="206" T="12" H="130" /><S L="10" o="f3f3" X="3063" H="406" Y="81" T="12" P="0,0,0.3,0.2,90,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="f3f3" H="130" Y="141" T="12" X="3263" /><S L="10" o="f3f3" H="130" X="3309" Y="141" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,50,0,0,0" L="10" o="f3f3" X="3443" Y="205" T="12" H="130" /><S L="3000" H="10" X="1244" Y="0" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="10" o="f3f3" H="800" X="3704" Y="80" T="12" P="0,0,0.3,0.2,90,0,0,0" /><S L="3000" X="2321" H="10" Y="0" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="43" X="400" H="10" Y="401" T="2" P="0,0,0,1.0,0,0,0,0" /><S L="43" H="10" X="845" Y="401" T="2" P="0,0,0,1.0,0,0,0,0" /><S L="43" X="1290" H="10" Y="401" T="2" P="0,0,0,1.0,0,0,0,0" /><S L="43" H="10" X="2180" Y="401" T="2" P="0,0,0,1.0,0,0,0,0" /><S L="43" X="1730" H="10" Y="401" T="2" P="0,0,0,1.0,0,0,0,0" /><S L="43" X="2621" H="10" Y="401" T="2" P="0,0,0,1.0,0,0,0,0" /><S L="43" H="10" X="3061" Y="402" T="2" P="0,0,0,1.0,0,0,0,0" /></S><D><DS Y="307" X="-149" /></D><O /></Z></C>',
  947.              '<C><P L="3463" D="connexion/x_forteresse/3.jpg, 600, 0, 2;connexion/x_forteresse/3.jpg, 1200, 0, 1;connexion/x_forteresse/3.jpg, 1800, 0, 1;connexion/x_forteresse/3.jpg, 2400, 0, 1;connexion/x_forteresse/3.jpg, 3000, 0, 1" /><Z><S><S L="3000" H="10" X="1244" Y="0" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="3000" X="2321" H="10" Y="0" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="10" H="10" X="528" Y="190" T="3" P="1,0,0,100,0,0,0,0" /><S P="1,0,0,100,0,0,0,0" L="10" X="90" N="" Y="191" T="3" H="10" /><S P="1,0,0,100,0,0,0,0" L="10" X="717" N="" Y="190" T="3" H="10" /><S L="10" H="10" X="272" Y="190" T="3" P="1,0,0,100,0,0,0,0" /><S X="178" L="193" H="10" c="4" Y="191" T="8" P="1,0,0.3,0.2,0,0,0,0" /><S P="1,0,0.3,0.2,0,0,0,0" L="193" X="622" c="4" Y="190" T="8" H="10" /><S L="10" H="10" X="1161" Y="190" T="3" P="1,0,0,100,0,0,0,0" /><S L="10" X="975" H="10" Y="190" T="3" P="1,0,0,100,0,0,0,0" /><S P="1,0,0.3,0.2,0,0,0,0" L="193" X="1066" c="4" Y="190" T="8" H="10" /><S L="10" H="10" X="1417" Y="191" T="3" P="1,0,0,100,0,0,0,0" /><S L="10" X="1605" H="10" Y="191" T="3" P="1,0,0,100,0,0,0,0" /><S H="10" L="193" X="1510" c="4" Y="190" T="8" P="1,0,0.3,0.2,0,0,0,0" /><S L="10" H="10" X="2049" Y="191" T="3" P="1,0,0,100,0,0,0,0" /><S L="10" X="1860" H="10" Y="190" T="3" P="1,0,0,100,0,0,0,0" /><S P="1,0,0.3,0.2,0,0,0,0" L="193" H="10" c="4" Y="190" T="8" X="1955" /><S L="10" H="10" X="2307" Y="190" T="3" P="1,0,0,100,0,0,0,0" /><S L="10" X="2493" H="10" Y="190" T="3" P="1,0,0,100,0,0,0,0" /><S X="2398" L="193" H="10" c="4" Y="190" T="8" P="1,0,0.3,0.2,0,0,0,0" /><S L="10" X="2748" H="10" Y="190" T="3" P="1,0,0,100,0,0,0,0" /><S L="10" H="10" X="2937" Y="190" T="3" P="1,0,0,100,0,0,0,0" /><S P="1,0,0.3,0.2,0,0,0,0" L="193" X="2842" c="4" Y="190" T="8" H="10" /><S L="10" H="10" X="3192" Y="190" T="3" P="1,0,0,100,0,0,0,0" /><S L="10" X="3381" H="10" Y="190" T="3" P="1,0,0,100,0,0,0,0" /><S H="10" L="193" X="3286" c="4" Y="190" T="8" P="1,0,0.3,0.2,0,0,0,0" /></S><D><DS Y="294" X="-159" /></D><O><O C="12" Y="190" X="178" P="0" /><O C="22" Y="190" X="90" P="0" /><O C="22" Y="190" X="272" P="0" /><O C="12" Y="190" P="0" X="624" /><O C="22" Y="190" P="0" X="718" /><O C="12" Y="190" X="1066" P="0" /><O C="12" Y="190" P="0" X="1509" /><O C="22" Y="190" X="1161" P="0" /><O C="22" Y="192" P="0" X="1605" /><O C="12" Y="191" X="1955" P="0" /><O C="22" Y="192" X="2049" P="0" /><O C="22" Y="190" P="0" X="975" /><O C="22" Y="190" P="0" X="1861" /><O C="22" Y="190" P="0" X="529" /><O C="22" Y="191" X="1418" P="0" /><O C="12" Y="190" P="0" X="2398" /><O C="22" Y="191" X="2307" P="0" /><O C="22" Y="190" P="0" X="2493" /><O C="12" Y="190" X="2842" P="0" /><O C="22" Y="190" P="0" X="2748" /><O C="22" Y="190" X="2938" P="0" /><O C="12" Y="190" P="0" X="3286" /><O C="22" Y="190" X="3192" P="0" /><O C="22" Y="190" P="0" X="3381" /></O></Z></C>',
  948.              '<C><P D="x_deadmeat/cinematique/106.jpg, 600, 0, 2;x_deadmeat/cinematique/106.jpg, 1200, 0, 1;x_deadmeat/cinematique/106.jpg, 1800, 0, 1;x_deadmeat/cinematique/106.jpg, 2400, 0, 1;x_deadmeat/cinematique/106.jpg, 3000, 0, 1" L="3463" /><Z><S><S L="3000" X="1244" H="10" Y="0" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="3000" H="10" X="2321" Y="0" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="10" o="d00d0d" X="78" H="150" Y="170" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="d00d0d" H="150" Y="170" T="12" X="278" /><S L="20" H="10" X="83" Y="246" T="2" P="0,0,0,0.5,45,0,0,0" /><S L="20" X="272" H="10" Y="246" T="2" P="0,0,0,0.5,-45,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="1c59d9" H="150" Y="170" T="12" X="522" /><S L="10" o="1c59d9" H="150" X="722" Y="170" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S L="20" X="527" H="10" Y="246" T="2" P="0,0,0,0.5,45,0,0,0" /><S L="20" H="10" X="716" Y="246" T="2" P="0,0,0,0.5,-45,0,0,0" /><S L="10" o="ffe300" H="150" X="966" Y="170" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="ffe300" X="1166" Y="170" T="12" H="150" /><S L="20" H="10" X="971" Y="246" T="2" P="0,0,0,0.5,45,0,0,0" /><S L="20" X="1160" H="10" Y="246" T="2" P="0,0,0,0.5,-45,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="19c52e" X="1410" Y="170" T="12" H="150" /><S L="10" o="19c52e" X="1610" H="150" Y="170" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S L="20" X="1415" H="10" Y="246" T="2" P="0,0,0,0.5,45,0,0,0" /><S L="20" H="10" X="1604" Y="246" T="2" P="0,0,0,0.5,-45,0,0,0" /><S L="10" o="ff8300" X="1854" H="150" Y="170" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="ff8300" H="150" Y="170" T="12" X="2054" /><S L="20" H="10" X="1859" Y="246" T="2" P="0,0,0,0.5,45,0,0,0" /><S L="20" X="2048" H="10" Y="246" T="2" P="0,0,0,0.5,-45,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="ff00f6" H="150" Y="170" T="12" X="2298" /><S L="20" X="2303" H="10" Y="246" T="2" P="0,0,0,0.5,45,0,0,0" /><S L="10" o="ff00f6" H="150" X="2498" Y="170" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S L="20" H="10" X="2492" Y="246" T="2" P="0,0,0,0.5,-45,0,0,0" /><S L="10" o="9100ff" H="150" X="2742" Y="170" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S L="20" H="10" X="2747" Y="246" T="2" P="0,0,0,0.5,45,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="9100ff" X="2942" Y="170" T="12" H="150" /><S L="20" X="2936" H="10" Y="246" T="2" P="0,0,0,0.5,-45,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="f3f3" X="3186" Y="170" T="12" H="150" /><S L="10" o="f3f3" X="3386" H="150" Y="170" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S L="20" X="3191" H="10" Y="246" T="2" P="0,0,0,0.5,45,0,0,0" /><S L="20" H="10" X="3380" Y="246" T="2" P="0,0,0,0.5,-45,0,0,0" /></S><D><DS Y="298" X="-145" /></D><O><O C="3" Y="180" P="0" X="178" /><O C="12" Y="180" P="0" X="180" /><O C="3" Y="180" X="622" P="0" /><O C="12" Y="180" X="622" P="0" /><O C="3" Y="180" P="0" X="1066" /><O C="12" Y="180" P="0" X="1066" /><O C="3" Y="180" X="1510" P="0" /><O C="12" Y="180" X="1510" P="0" /><O C="3" Y="180" P="0" X="1954" /><O C="12" Y="180" P="0" X="1954" /><O C="3" Y="180" X="2398" P="0" /><O C="12" Y="180" X="2398" P="0" /><O C="3" Y="180" P="0" X="2842" /><O C="12" Y="180" P="0" X="2842" /><O C="3" Y="180" X="3286" P="0" /><O C="12" Y="180" X="3286" P="0" /></O></Z></C>'
  949.             }
  950.     map = mapas[math.random(#mapas)]
  951.     cn1 = {}
  952.     cn2 = {}
  953.     cn3 = {}
  954.     cn4 = {}
  955.     cn5 = {}
  956.     cn6 = {}
  957.     cn7 = {}
  958.     cn8 = {}
  959.     cnsy = {}
  960.     if map == mapas[1] then
  961.         pad()
  962.     end
  963.     if map == mapas[2] then
  964.         cnsy = {179}
  965.         cn1 = {4, 178, 345}
  966.         cn2 = {448, 622, 789}
  967.         cn3 = {892, 1066, 1233}
  968.         cn4 = {1336, 1510, 1677}
  969.         cn5 = {1780, 1954, 2121}
  970.         cn6 = {2224, 2398, 2565}
  971.         cn7 = {2668, 2842, 3009}
  972.         cn8 = {3112, 3286, 3453}
  973.     end
  974.     if map == mapas[3] then
  975.         pad()
  976.     end
  977.     if map == mapas[4] then
  978.         cnsy = {80}
  979.         for nc1 = 98, 258, 1 do
  980.             table.insert(cn1, nc1)
  981.         end
  982.         for nc2 = 542, 702, 1 do
  983.             table.insert(cn2, nc2)
  984.         end
  985.         for nc3 = 986, 1146, 1 do
  986.             table.insert(cn3, nc3)
  987.         end
  988.         for nc4 = 1430, 1590, 1 do
  989.             table.insert(cn4, nc4)
  990.         end
  991.         for nc5 = 1874, 2034, 1 do
  992.             table.insert(cn5, nc5)
  993.         end
  994.         for nc6 = 2318, 2478, 1 do
  995.             table.insert(cn6, nc6)
  996.         end
  997.         for nc7 = 2762, 2922, 1 do
  998.             table.insert(cn7, nc7)
  999.         end
  1000.         for nc8 = 3206, 3366, 1 do
  1001.             table.insert(cn8, nc8)
  1002.         end
  1003.     end
  1004.     tfm.exec.newGame(map)
  1005.     spawn()
  1006. end
  1007.  
  1008. function spawnCannon()
  1009.     if lifer > 0 then
  1010.         t1 = tfm.exec.addShamanObject(17, cn1[math.random(#cn1)], cnsy[math.random(#cnsy)], 0, 0, 0, false)
  1011.         table.insert(objectList, t1)
  1012.     end
  1013.     if lifeb > 0 then
  1014.         t2 = tfm.exec.addShamanObject(17, cn2[math.random(#cn2)], cnsy[math.random(#cnsy)], 0, 0, 0, false)
  1015.         table.insert(objectList, t2)
  1016.     end
  1017.     if lifey > 0 then
  1018.         t3 = tfm.exec.addShamanObject(17, cn3[math.random(#cn3)], cnsy[math.random(#cnsy)], 0, 0, 0, false)
  1019.         table.insert(objectList, t3)
  1020.     end
  1021.     if lifeg > 0 then
  1022.         t4 = tfm.exec.addShamanObject(17, cn4[math.random(#cn4)], cnsy[math.random(#cnsy)], 0, 0, 0, false)
  1023.         table.insert(objectList, t4)
  1024.     end
  1025.     if lifeo > 0 then
  1026.         t5 = tfm.exec.addShamanObject(17, cn5[math.random(#cn5)], cnsy[math.random(#cnsy)], 0, 0, 0, false)
  1027.         table.insert(objectList, t5)
  1028.     end
  1029.     if lifero > 0 then
  1030.         t6 = tfm.exec.addShamanObject(17, cn6[math.random(#cn6)], cnsy[math.random(#cnsy)], 0, 0, 0, false)
  1031.         table.insert(objectList, t6)
  1032.     end
  1033.     if lifep > 0 then
  1034.         t7 = tfm.exec.addShamanObject(17, cn7[math.random(#cn7)], cnsy[math.random(#cnsy)], 0, 0, 0, false)
  1035.         table.insert(objectList, t7)
  1036.     end
  1037.     if lifec > 0 then
  1038.         t8 = tfm.exec.addShamanObject(17, cn8[math.random(#cn8)], cnsy[math.random(#cnsy)], 0, 0, 0, false)
  1039.         table.insert(objectList, t8)
  1040.     end
  1041. end
  1042. function collect()
  1043.     coordX = {}
  1044.     coordY = {}
  1045.     if lifer > 0 then
  1046.         checkidx(objectList, t1)
  1047.         objX1 = tfm.get.room.objectList[objectList[v]].x
  1048.         checkidy(objectList, t1)
  1049.         objY1 = tfm.get.room.objectList[objectList[b]].y
  1050.         table.insert(coordX, objX1)
  1051.         table.insert(coordY, objY1)
  1052.     end
  1053.     if lifeb > 0 then
  1054.         checkidx(objectList, t2)
  1055.         objX2 = tfm.get.room.objectList[objectList[v]].x
  1056.         checkidy(objectList, t2)
  1057.         objY2 = tfm.get.room.objectList[objectList[b]].y
  1058.         table.insert(coordX, objX2)
  1059.         table.insert(coordY, objY2)
  1060.     end
  1061.     if lifey > 0 then
  1062.         checkidx(objectList, t3)
  1063.         objX3 = tfm.get.room.objectList[objectList[v]].x
  1064.         checkidy(objectList, t3)
  1065.         objY3 = tfm.get.room.objectList[objectList[b]].y
  1066.         table.insert(coordX, objX3)
  1067.         table.insert(coordY, objY3)
  1068.     end
  1069.     if lifeg > 0 then
  1070.         checkidx(objectList, t4)
  1071.         objX4 = tfm.get.room.objectList[objectList[v]].x
  1072.         checkidy(objectList, t4)
  1073.         objY4 = tfm.get.room.objectList[objectList[b]].y
  1074.         table.insert(coordX, objX4)
  1075.         table.insert(coordY, objY4)    
  1076.     end
  1077.     if lifeo > 0 then
  1078.         checkidx(objectList, t5)
  1079.         objX5 = tfm.get.room.objectList[objectList[v]].x
  1080.         checkidy(objectList, t5)
  1081.         objY5 = tfm.get.room.objectList[objectList[b]].y
  1082.         table.insert(coordX, objX5)
  1083.         table.insert(coordY, objY5)
  1084.     end
  1085.     if lifero > 0 then
  1086.         checkidx(objectList, t6)
  1087.         objX6 = tfm.get.room.objectList[objectList[v]].x
  1088.         checkidy(objectList, t6)
  1089.         objY6 = tfm.get.room.objectList[objectList[b]].y
  1090.         table.insert(coordX, objX6)
  1091.         table.insert(coordY, objY6)
  1092.     end
  1093.     if lifep > 0 then
  1094.         checkidx(objectList, t7)
  1095.         objX7 = tfm.get.room.objectList[objectList[v]].x
  1096.         checkidy(objectList, t7)
  1097.         objY7 = tfm.get.room.objectList[objectList[b]].y
  1098.         table.insert(coordX, objX7)
  1099.         table.insert(coordY, objY7)
  1100.     end
  1101.     if lifec > 0 then
  1102.         checkidx(objectList, t8)
  1103.         objX8 = tfm.get.room.objectList[objectList[v]].x
  1104.         checkidy(objectList, t8)
  1105.         objY8 = tfm.get.room.objectList[objectList[b]].y
  1106.         table.insert(coordX, objX8)
  1107.         table.insert(coordY, objY8)
  1108.     end
  1109. end
  1110. function checkidx(arg1, arg2)
  1111.     for ml = 1, #arg1, 1 do
  1112.         if arg2 == arg1[ml] then
  1113.             v = ml
  1114.         end
  1115.     end
  1116. end
  1117. function checkidy(arg3, arg4)
  1118.     for l = 1, #arg3, 1 do
  1119.         if arg4 == arg3[l] then
  1120.             b = l
  1121.         end
  1122.     end
  1123. end
  1124. function attLife(nome)
  1125.     ui.addTextArea(0, "<p align='center'><font size='15px'><b>"..lifer.."", nome, 154, 56, 50, 30, 0x161616, 0x161616, 0, false)
  1126.     ui.addTextArea(1, "<p align='center'><font size='15px'><b>"..lifeb.."", nome, 598, 56, 50, 30, 0x161616, 0x161616, 0, false)
  1127.     ui.addTextArea(16, "<p align='center'><font size='15px'><b>"..lifey.."", nome, 1042, 56, 50, 30, 0x161616, 0x161616, 0, false)
  1128.     ui.addTextArea(17, "<p align='center'><font size='15px'><b>"..lifeg.."", nome, 1486, 56, 50, 30, 0x161616, 0x161616, 0, false)
  1129.     ui.addTextArea(18, "<p align='center'><font size='15px'><b>"..lifeo.."", nome, 1929, 56, 50, 30, 0x161616, 0x161616, 0, false)
  1130.     ui.addTextArea(19, "<p align='center'><font size='15px'><b>"..lifero.."", nome, 2374, 56, 50, 30, 0x161616, 0x161616, 0, false)
  1131.     ui.addTextArea(21, "<p align='center'><font size='15px'><b>"..lifep.."", nome, 2818, 56, 50, 30, 0x161616, 0x161616, 0, false)
  1132.     ui.addTextArea(22, "<p align='center'><font size='15px'><b>"..lifec.."", nome, 3262, 56, 50, 30, 0x161616, 0x161616, 0, false)
  1133. end
  1134. function repita(jogador)
  1135.     ui.addTextArea(4001, mice[jogador].tr.text6, jogador, 100, 50, 600, 100, 0x0e232b, 0x171717, 1, true)
  1136.     ui.addTextArea(4002, mice[jogador].tr.text7, jogador, 100, 150, 600, 200, 0x0e232b, 0x171717, 1, true)
  1137.     ui.addTextArea(4003, "<p align='center'><font size='15px'><a href='event:fecha'><r>X<n>", jogador, 650, 60, 30, 20, 0x0e232b, 0x171717, 1, true)
  1138. end
  1139. function removeText()
  1140.     for text = 0, 22, 1 do
  1141.         ui.removeTextArea(text)
  1142.     end
  1143.     if inGame == false then
  1144.         ui.removeTextArea(3000)
  1145.     end
  1146.     ui.removeTextArea(5000)
  1147. end
  1148. function limpar()
  1149.     if #objectList > 0 then
  1150.         for obj = 1, #objectList, 1 do
  1151.             tfm.exec.removeObject(objectList[obj])
  1152.         end
  1153.     end
  1154.     objectList = {}
  1155.     if #portaisid > 0 then
  1156.         for idobj = 1, #portaisid, 1 do
  1157.             tfm.exec.removeObject(portaisid[idobj])
  1158.         end
  1159.     end
  1160.     portaisid = {}
  1161.     for piso = 0, 24, 1 do
  1162.         tfm.exec.removePhysicObject(piso)
  1163.     end
  1164.     for piso3 = 98, 105, 1 do
  1165.         tfm.exec.removePhysicObject(piso3)
  1166.     end
  1167.     if fim == true then
  1168.         for piso2 = 50, 97, 1 do
  1169.             tfm.exec.removePhysicObject(piso2)
  1170.         end
  1171.     end
  1172. end
  1173. function spawn()
  1174.     valor = 178
  1175.     valor7 = 1
  1176.     cor = {0xD00D0D, 0x1C59D9, 0xFFE300, 0x19C52E, 0xFF8300, 0xFF00F6, 0x9100FF, 0x00F3F3}
  1177.     for h = 50, 57, 1 do
  1178.         tfm.exec.addPhysicObject(h, valor, 401, {
  1179.         type = 12,
  1180.         color = cor[valor7],
  1181.         width = 200,
  1182.         height = 10,
  1183.         friction = 5000,
  1184.         restitution = .2,
  1185.         miceCollision = false,
  1186.         groundCollision = true})
  1187.         valor = valor + 444
  1188.         valor7 = valor7 + 1
  1189.     end
  1190.     valor1 = 83
  1191.     for j = 58, 65, 1 do
  1192.         tfm.exec.addPhysicObject(j, valor1, 390, {
  1193.         type = 2,
  1194.         color = 0xFFFFFF,
  1195.         width = 10,
  1196.         height = 20,
  1197.         friction = 0,
  1198.         restitution = 1.3,
  1199.         miceCollision = false,
  1200.         groundCollision = true})
  1201.         valor1 = valor1 + 444
  1202.     end
  1203.     valor6 = 83
  1204.     valor8 = 1
  1205.     for jj = 90, 97, 1 do
  1206.         tfm.exec.addPhysicObject(jj, valor6 + 1, 391, {
  1207.         type = 12,
  1208.         color = cor[valor8],
  1209.         width = 10,
  1210.         height = 20,
  1211.         friction = 5000,
  1212.         restitution = 0,
  1213.         miceCollision = false,
  1214.         groundCollision = true})
  1215.         valor6 = valor6 + 444
  1216.         valor8 = valor8 + 1
  1217.     end
  1218.     valor2 = 273
  1219.     for q = 66, 73, 1 do
  1220.         tfm.exec.addPhysicObject(q, valor2, 390, {
  1221.         type = 2,
  1222.         color = math.random(0xFFFFFF),
  1223.         width = 10,
  1224.         height = 20,
  1225.         friction = 5000,
  1226.         restitution = 1.3,
  1227.         miceCollision = false,
  1228.         groundCollision = true})
  1229.         valor2 = valor2 + 444
  1230.     end
  1231.     valor5 = 273
  1232.     valor9 = 1
  1233.     for gg = 82, 89, 1 do
  1234.         tfm.exec.addPhysicObject(gg, valor5 - 1, 391, {
  1235.         type = 12,
  1236.         color = cor[valor9],
  1237.         width = 10,
  1238.         height = 20,
  1239.         friction = 5000,
  1240.         restitution = 0,
  1241.         miceCollision = false,
  1242.         groundCollision = true})
  1243.         valor5 = valor5 + 444
  1244.         valor9 = valor9 + 1
  1245.     end
  1246.     valor3 = 178
  1247.     valor4 = 1
  1248.         for p = 74, 81, 1 do
  1249.         tfm.exec.addPhysicObject(p, valor3, 66, {
  1250.         type = 13,
  1251.         color =  cor[valor4],
  1252.         width = 20,
  1253.         height = 0,
  1254.         friction = 0,
  1255.         restitution = .2,
  1256.         miceCollision = false,
  1257.         groundCollision = false})
  1258.         valor3 = valor3 + 444
  1259.         valor4 = valor4 + 1
  1260.     end
  1261. end
  1262. function checkl()
  1263.     if lifer > 0 then
  1264.         ui.addTextArea(3, "", player1, 118, 302, 123, 58, 0x00FF21, 0x63EC47, 0.1, false)
  1265.     end
  1266.     if lifeb > 0 then
  1267.         ui.addTextArea(4, "", player2, 563, 302, 123, 58, 0x00FF21, 0x63EC47, 0.1, false)
  1268.     end
  1269.     if lifey > 0 then
  1270.         ui.addTextArea(5, "", player3, 1008, 302, 123, 58, 0x00FF21, 0x63EC47, 0.1, false)
  1271.     end
  1272.     if lifeg > 0 then
  1273.         ui.addTextArea(6, "", player4, 1453, 302, 123, 58, 0x00FF21, 0x63EC47, 0.1, false) 
  1274.     end
  1275.     if lifeo > 0 then
  1276.         ui.addTextArea(8, "", player5, 1898, 302, 123, 58, 0x00FF21, 0x63EC47, 0.1, false)
  1277.     end
  1278.     if lifero > 0 then
  1279.         ui.addTextArea(9, "", player6, 2343, 302, 123, 58, 0x00FF21, 0x63EC47, 0.1, false)
  1280.     end
  1281.     if lifep > 0 then
  1282.         ui.addTextArea(10, "", player7, 2783, 302, 123, 58, 0x63EC47, 0x63EC47, 0.1, false)
  1283.     end
  1284.     if lifec > 0 then
  1285.         ui.addTextArea(11, "", player8, 3223, 302, 123, 58, 0x63EC47, 0x63EC47, 0.1, false)
  1286.     end
  1287. end
  1288.  
  1289. function objcoords()
  1290.     initGoalExtension = {90, 534, 978, 1422, 1866, 2310, 2754, 3198}
  1291.     endGoalExtension = {265, 709, 1153, 1597, 2041, 2485, 2929, 3373}
  1292.     for i = 1, #initGoalExtension  do
  1293.         cannonCheckCoordinates(initGoalExtension[i], endGoalExtension[i])
  1294.     end
  1295.     condi2 = condi2 + 1
  1296. end
  1297.  
  1298. function cannonCheckCoordinates(InitExtensionGoal, EndExtensionGoal)
  1299.     for cn = 1, #coordX do
  1300.         if coordX[cn] >= InitExtensionGoal and coordX[cn] <= EndExtensionGoal then
  1301.             if coordY[cn] == 381 then
  1302.                 lostLife(InitExtensionGoal)
  1303.             end
  1304.         end
  1305.     end
  1306. end
  1307. function lostLife(InitExtensionGoal)
  1308.     if lifer > 0 then
  1309.         if InitExtensionGoal == 90 then
  1310.             lifer = lifer - 1
  1311.         end
  1312.     end
  1313.     if lifeb > 0 then
  1314.         if InitExtensionGoal == 534 then
  1315.             lifeb = lifeb - 1
  1316.         end
  1317.     end
  1318.     if lifey > 0 then
  1319.         if InitExtensionGoal == 978 then
  1320.             lifey = lifey - 1
  1321.         end
  1322.     end
  1323.     if lifeg > 0 then
  1324.         if InitExtensionGoal == 1422 then
  1325.             lifeg = lifeg - 1
  1326.         end
  1327.     end
  1328.     if lifeo > 0 then
  1329.         if InitExtensionGoal == 1866 then
  1330.             lifeo = lifeo - 1
  1331.         end
  1332.     end
  1333.     if lifero > 0 then
  1334.         if InitExtensionGoal == 2310 then
  1335.             lifero = lifero - 1
  1336.         end
  1337.     end
  1338.     if lifep > 0 then
  1339.         if InitExtensionGoal == 2754 then
  1340.             lifep = lifep - 1
  1341.         end
  1342.     end
  1343.     if lifec > 0 then
  1344.         if InitExtensionGoal == 3198 then
  1345.             lifec = lifec - 1
  1346.         end
  1347.     end
  1348.     attLife(nil)
  1349. end
  1350. function portais()
  1351.     port1 = tfm.exec.addShamanObject(26, math.random(118, 3338), math.random(307, 345), 0, 0, 0, false)
  1352.     port2 = tfm.exec.addShamanObject(27, math.random(118, 3338), math.random(307, 345), 0, 0, 0, false)
  1353.     table.insert(portaisid, port1)
  1354.     table.insert(portaisid, port2)
  1355. end
  1356. function spawnT()
  1357.     valor10 = 178
  1358.     for vnb = 98, 105, 1 do
  1359.         tfm.exec.addPhysicObject(vnb, valor10, 362, {
  1360.         type = 8,
  1361.         width = 200,
  1362.         height = 10,
  1363.         miceColission = true,
  1364.         groundCollision = true})
  1365.         valor10 = valor10 + 444
  1366.     end
  1367. end
  1368. function teleportPlayers()
  1369.     value = 178
  1370.     for hgj = 1, #players do
  1371.         tfm.exec.movePlayer (players[hgj], value, 10000, false, 0, 0, false)
  1372.         value = value + 444
  1373.     end
  1374. end
  1375. function pad()
  1376.     for nc1 = 136, 212, 1 do
  1377.         table.insert(cn1, nc1)
  1378.     end
  1379.     for nc2 = 582, 658, 1 do
  1380.         table.insert(cn2, nc2)
  1381.     end
  1382.     for nc3 = 1028, 1104, 1 do
  1383.         table.insert(cn3, nc3)
  1384.     end
  1385.     for nc4 = 1474, 1550, 1 do
  1386.         table.insert(cn4, nc4)
  1387.     end
  1388.     for nc5 = 1920, 1996, 1 do
  1389.         table.insert(cn5, nc5)
  1390.     end
  1391.     for nc6 = 2366, 2442, 1 do
  1392.         table.insert(cn6, nc6)
  1393.     end
  1394.     for nc7 = 2812, 2888, 1 do
  1395.         table.insert(cn7, nc7)
  1396.     end
  1397.     for nc8 = 3258, 3334, 1 do
  1398.         table.insert(cn8, nc8)
  1399.     end
  1400.     for ncsy = 93, 254, 1 do
  1401.         table.insert(cnsy, ncsy)
  1402.     end
  1403. end
  1404. iniciar()
Add Comment
Please, Sign In to add comment