Novohp

Portal_l´s V. 0.5

Nov 12th, 2016
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.13 KB | None | 0 0
  1. -- Mensagens de boas vindas
  2. ui.addTextArea(1, "<p align='center'><a href='event:close'><b>Fechar</a></p>", name, 308.55, 334, 180, 24, 0x324650, 0x0, 0.8, true)
  3. ui.addTextArea(0, "<center><font size=\"15\"><p align=\"center\">Welcome To Time Portals</center></p><br><br><font size=\"13\"> <b>A game in which you and your friends must use the portals to get pass the incredible maps. Challenging! <br><br><br><br><br><br><br><br><p align=\"right\">Version: 0.5<br><br>", nane, 206.5, 93, 387, 214)
  4.  
  5. function eventTextAreaCallback(t,p,c)
  6.     if c == [[close]] then
  7.         for i = 0,2 do
  8.             ui.removeTextArea(i,p)
  9.         end
  10. end
  11. end
  12. -- portais
  13. if k == 32 and tfm.get.room.playerList[p].isFacingRight == true and info[p].time < os.time()-1500 then
  14.             info[p].time = os.time()
  15.             tfm.exec.movePlayer(p,0,0,true,100,0,false)
  16.         elseif k == 32 and tfm.get.room.playerList[p].isFacingRight == false and info[p].time < os.time()-1500 then
  17.             info[p].time = os.time()
  18.             tfm.exec.movePlayer(p,0,0,true,-100,0,false)
  19.         end
  20.  local facingLeft = {}
  21.  
  22. for name in pairs(tfm.get.room.playerList) do
  23. for _,key in pairs{0,2,3} do system.bindKeyboard(name, key, true)
  24.     end
  25. end
  26.  
  27.     function eventKeyboard(name, key, down, x, y)
  28.         if key == 0 or key == 2 then
  29.         facingLeft[name] = key == 0
  30.         elseif key == 3 then
  31.         if facingLeft[name] then
  32.          tfm.exec.addShamanObject(27, x - 8, y - 5, 0, 20)
  33.          tfm.exec.addShamanObject(24, x - 8, y - 5, 0, 20)
  34. else
  35.          tfm.exec.addShamanObject(26, x + 8, y - 5, 0, 20)
  36.          tfm.exec.addShamanObject(24, x + 8, y - 5, 0, 20)
  37.         end
  38.     end
  39. end
  40. --- Desabilitações
  41.     tfm.exec.disableAutoShaman()
  42.     function eventPlayerWon(p)
  43.       tfm.exec.respawnPlayer(p)
  44. end
  45.     function eventPlayerWon(p)
  46.         tfm.exec.respawnPlayer(p)
  47. end
  48. tfm.exec.disableAutoTimeLeft()
  49.  
  50.  
  51. ---Rotação de mapas
  52. maps={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,69,65,64,61,62,63,70,71,72,73,74,75,76,77,78,79,8,81,82,83,200,201,210}
  53.     vivo=0;
  54.     tfm.exec.disableAutoNewGame(true)
  55.     function novaRodada()
  56.      tfm.exec.newGame(maps[math.random(#maps)])
  57.     end
  58.     novaRodada();
  59.     function eventNewGame()
  60.         vivo=0; -- A Variavel vivo Reseta
  61.         for p in pairs(tfm.get.room.playerList) do -- Pra Todos Os Jogadores Da Sala
  62.         vivo=vivo+1; -- Soma Da Variavel vivo
  63.     end
  64. end
  65.     function eventPlayerLeft(p)
  66.      if not tfm.get.room.playerList
  67.         .isDead then -- Verifica Se o Jogador Está Morto
  68.         vivo=vivo-1; -- Se Ele Não Estiver, A Variavel Perde 1
  69.     end
  70. end
  71.     function eventPlayerDied(p)
  72.         vivo=vivo-1;
  73. end
  74.     function eventLoop()
  75. end
  76.     function eventLoop(tempoPassado,tepoFaltando)
  77. end
  78.     function eventLoop(tempoPassado,tempoFaltando)
  79.      if vivo==0 or tempoFaltando <= 0 then -- Verifica se A Variavel vivo Chegou a 0 Ou Se o Tempo Restante Do Mapa Chegou a 0
  80.         novaRodada();
  81.     end
  82. end
  83. -- Jogador morre recucita
  84.     function eventPlayerDied(p)
  85.         tfm.exec.respawnPlayer(p)
  86. end
Add Comment
Please, Sign In to add comment