Advertisement
Tectoon

[TFM] Rotação de Natal + Admin

Sep 24th, 2015
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.98 KB | None | 0 0
  1. admin = "Sagazgamer"
  2.  
  3. ---Rotação de mapa ---
  4. tfm.exec.disableAutoNewGame(true);
  5. mapas={"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","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59","60","61","62","63","64","65","66","67","68","69","70","71","72","73","74","75","76","77","78","79","80","81","82","83","84","85","86","87","88","89","90","91","92","93","94","95","96","97","98","99","100","6266159"}
  6.  
  7. function nextRound()
  8.     tfm.exec.newGame(mapas[math.random(#mapas)]);
  9.     tfm.exec.setUIMapName("<J>#Especial de Natal - <ROSE> Emos s2</j>")
  10.     tfm.exec.snow()
  11. end
  12.  
  13. function eventNewGame()
  14.     vivo=0
  15.     for name,player in pairs(tfm.get.room.playerList) do
  16.         vivo=vivo+1
  17.     end
  18. end
  19.  
  20. function eventPlayerDied(name)
  21.     vivo=vivo-1
  22. end
  23.  
  24. function eventPlayerWon(name)
  25.     vivo=vivo-1
  26. end
  27.  
  28. function eventLoop(tempoPassado, tempoFaltando)
  29.     if vivo == 0 or tempoFaltando < 1000 then
  30.         nextRound();
  31.     end
  32. end
  33.  
  34. nextRound();
  35.  
  36. for p in pairs(tfm.get.room.playerList) do
  37. tfm.exec.bindKeyboard(p, 69, true, true)
  38. end
  39.  
  40. time = os.time() + 2500
  41.  
  42. function eventKeyboard(p, keyCode, down, x, y)
  43. if keyCode == 69 then
  44. if os.time() > time then
  45. if tfm.get.room.playerList[p].isFacingRight == true then
  46. time = os.time() + 2500
  47. tfm.exec.addShamanObject(34,x+20,y,true, 10, -5)
  48. else
  49. tfm.exec.addShamanObject(34,x-20,y,true,-10, -5)
  50. time = os.time() + 2500
  51. end
  52. end
  53. end
  54. end
  55.  
  56. ui.addTextArea(2,"<a href='event:natal'>Evento</a>",admin,5,25,44,20,nil,0xBabd2f,0.7,true)
  57.  
  58. function chooseHouse(event)
  59.  
  60. if event=="natal" then
  61. tfm.exec.newGame([[@6266159]])
  62. tfm.exec.setUIMapName("<J>#Especial de Natal - <ROSE> Emos s2</j>")
  63. end
  64. end
  65.  
  66. function eventTextAreaCallback(id,playerName,event)
  67.         if playerName==tostring(admin) then
  68.                 chooseHouse(event)
  69.         end
  70. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement