Advertisement
Tectoon

[TFM] Vanilla

Aug 4th, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.63 KB | None | 0 0
  1. tfm.exec.disableAutoNewGame(true)
  2. 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","88","90","91","92","93","94","95","96","97","98","99","100","101","102","103","104","105","106","107","128","129","130","131","132","133","201","202","203","204","205","206","207","208","209","210"}
  3. pos=0;
  4. vivo=0;
  5. sala=0;
  6. local tempo=90;
  7. function eventLoop(currentTime, timeRemaining)
  8.     tempo = tempo -0.5
  9.     if (tempo%1 == 0) then
  10.     T = string.format("%.2d:%.2d",tempo/60%60, tempo%60)
  11.     tfm.exec.setUIMapName("<N>Tempo restante: <J>"..T.." <N>/ Ratos na sala: <J>"..sala.." <N>/ Ratos vivos: <J>"..vivo.."</J>")
  12.     end
  13.     if tempo <= 0 or vivo == 0 then
  14.         tfm.exec.newGame(mapas[math.random(#mapas)])
  15.     end
  16. end
  17. function eventPlayerWon(playerName)
  18.     pos=pos+1
  19.     vivo=vivo-1
  20.     if pos == 1 then
  21.         ui.addPopup(0, 0, "ParabĂ©ns "..playerName.."! VocĂȘ firstou!", NIL, 300, 30, 300, true)
  22.     end
  23. end
  24. function eventPlayerDied(playerName)
  25.     vivo=vivo-1
  26. end
  27. function eventNewGame()
  28.     tempo=90;
  29.     vivo=0;
  30.     sala=0;
  31.     pos=0;
  32.     for name,player in pairs(tfm.get.room.playerList) do
  33.         sala=sala+1
  34.         vivo=vivo+1
  35.     end
  36. end
  37. function eventPlayerLeft(playerName)
  38.     vivo=vivo-1
  39.     sala=sala-1
  40. end
  41. tfm.exec.newGame(mapas[math.random(#mapas)])
  42. function eventNewPlayer(playerName)
  43.     sala=sala+1
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement