Advertisement
Eliaseeg

Doble rotación de mapas.

Feb 7th, 2014
606
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.24 KB | None | 0 0
  1. rotacion = {"3", "4"}
  2. rotaciona = {"1", "2"}
  3.  
  4. r=0;
  5. meow=0;
  6.  
  7. function main()
  8. tfm.exec.disableAutoScore (true);
  9. tfm.exec.disableAutoNewGame(true)
  10. tfm.exec.disableAutoShaman(true)
  11. tfm.exec.newGame(rotacion[math.random(#rotacion)])
  12. end
  13.  
  14. function eventNewGame()
  15.     r=r+1;
  16.     if r == 1 then
  17.         rotacion1()
  18.     end
  19.     if r == 2 then
  20.         rotacion2()
  21.     end
  22.     if r == 3 then
  23.         rotacion1()
  24.     end
  25. end
  26.  
  27. function rotacion1()
  28. r=1;
  29.             print("Estás en la rotación 1")
  30.              for player in pairs(tfm.get.room.playerList) do
  31.                 meow=meow+1;
  32.                 end
  33. end
  34.  
  35. function rotacion2()
  36.             print("Estás en la rotación 2")
  37.             for player in pairs(tfm.get.room.playerList) do
  38.         meow=meow+1;
  39.         end
  40. end
  41.  
  42.  
  43. function eventLoop(ct,rt)
  44.     if rt <=  0 then
  45.         if r == 1 then
  46.             tfm.exec.newGame(rotaciona[math.random(#rotaciona)])
  47.         end
  48.         if r == 2 then
  49.             tfm.exec.newGame(rotacion[math.random(#rotacion)])
  50.         end
  51.     end
  52.         if meow == 0 then
  53.         if r == 1 then
  54.             tfm.exec.newGame(rotaciona[math.random(#rotaciona)])
  55.         end
  56.         if r == 2 then
  57.             tfm.exec.newGame(rotacion[math.random(#rotacion)])
  58.         end
  59.     end
  60. end
  61.  
  62. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement