Tectoon

[TFM] Rotação 2 Shaman (Período de Teste)

Aug 2nd, 2015
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.10 KB | None | 0 0
  1. tfm.exec.disableAutoNewGame(true)
  2. tfm.exec.disableAutoShaman(true)
  3. tfm.exec.disableAutoScore(true)
  4.  
  5. local alive = 0
  6. local maxscore = 0
  7. local won = 0
  8. local sh = 2
  9.  
  10. maps = {[[1]], [[2]]}
  11.  
  12. eventNewGame = function()
  13.     sh = 2
  14.     alive = 0
  15.     maxscore = 0
  16.     for i in pairs(tfm.get.room.playerList) do
  17.         alive = alive + 1
  18.         for l = 1,2 do
  19.             if tfm.get.room.playerList[i].score < maxscore + 1 and sh ~= 0 then
  20.                 sh = sh - 1
  21.                 tfm.exec.setShaman(i)
  22.                 tfm.exec.setPlayerScore(i, 0, false)
  23.                 if sh == 1 then
  24.                     tfm.exec.setNameColor(i, 0xFEB1FC)
  25.                 end
  26.             end
  27.         end
  28.     end
  29. end
  30.  
  31. eventPlayerWon = function(p)
  32.     alive = alive - 1
  33.     if not tfm.get.room.playerList[p].isShaman == true then
  34.         won = won + 1
  35.         tfm.exec.setPlayerScore(p, 10, true)
  36.         if won == 1 then
  37.             maxscore = maxscore + 10
  38.         end
  39.     end
  40. end
  41.  
  42. eventPlayerDied = function(p)
  43.     alive = alive - 1
  44. end
  45.  
  46. eventLoop = function(tp, tr)
  47.     if tr < 100 or alive == 0 then
  48.         eventNextGame()
  49.     end
  50. end
  51.  
  52. eventNextGame = function(m)
  53.     if m then
  54.         tfm.exec.newGame(m)
  55.     elseif not m then
  56.         tfm.exec.newGame(maps[math.random(#maps)])
  57.     end
  58. end
Advertisement
Add Comment
Please, Sign In to add comment