Advertisement
Haxhhhhhhhhh

MiceTona BETA

Feb 20th, 2017
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.92 KB | None | 0 0
  1. tfm.exec.disableAutoNewGame(true)
  2. tfm.exec.disableAutoShaman(true)
  3. tfm.exec.disableAutoScore(true)
  4. tfm.exec.disableAutoTimeLeft(true)
  5. mapas={7059252,7060029,7060037}
  6. temporizador=60
  7. modo="desativado"
  8. vivo=0
  9. nivel=0
  10. permitido=false
  11. function eventNewPlayer(name)
  12.     tfm.exec.chatMessage("<J>Sejam bem-vindos ao module MiceTona, uma maratona de Transformice!<br><br>Nesse module você deve correr contra o tempo e chegar até o final do mapa. No final, o último que sobrar será o vencedor.<br><br><R>Module em construção!<br><ROSE>Script criado por Jhinsword350 e Jannawindmax",name)
  13. end
  14. function eventChatCommand(name,message)
  15.     if name == "Jhinsword350" then
  16.     if message == "bugar" then
  17.         system.exit()
  18.     end
  19.     if message == "run" then
  20.         tfm.exec.newGame(mapas[math.random(#mapas)])
  21.     end
  22.     if(message:sub(1,5) == "rodar") then
  23.         tfm.exec.newGame(message:sub(7)
  24.     end
  25.     end
  26. end
  27. function eventNewGame()
  28.     nivel=0
  29.     modo="desativado"
  30.     tfm.exec.setGameTime(60)
  31.     temporizador=65
  32.     for name,player in pairs(tfm.get.room.playerList) do
  33.         vivo=vivo+1
  34.         tfm.exec.setPlayerScore(name,0,false)
  35. end
  36. end
  37. function eventLoop(passado,tempo)
  38.     tfm.exec.setUIMapName("MiceTona! <R>BETA<J> Criado por Jhinsword350 e Jessiewind26")
  39.     local segundos=math.floor(tempo/1000)
  40. if modo == "desativado" and segundos >= 1 then
  41.         ui.addTextArea(0,"<font size='18'><p align='center'><font face='Segoe UI'>A partida vai começar em <b>"..segundos.."</b> segundos! Se preparem...",nil,5,360,800,35,0x000001,0x000001,1.0,true)
  42.     end
  43.     if modo == "desativado" and segundos == 0 then
  44.         segundos=10
  45.         tfm.exec.setGameTime(10)
  46.         modo="nivel"
  47.         temporizador=temporizador-5
  48.         nivel=nivel+1
  49.         ui.addTextArea(0,"<font size='18'><p align='center'><font face='Segoe UI'>Nível "..nivel..": Objetivo da corrida: Até "..temporizador.." segundos.",nil,5,360,800,35,0x000001,0x000001,1.0,true)
  50.         permitido=true
  51.     end
  52.     if modo == "nivel" then
  53.         if segundos < 4 then
  54.             ui.addTextArea(0,"<font size='99'><font color='#000000'><font face='Segoe UI'>"..segundos.."",nil,90,10,120,120,0,0,1.0,true)
  55.         end
  56.         if segundos < 1 then
  57.             if permitido == true then
  58.             modo="corrida"
  59.             ui.addTextArea(0,"<font size='18'><p align='center'><font face='Segoe UI'>Partida iniciada!",nil,5,360,800,35,0x000001,0x000001,1.0,true)
  60.             for name,player in pairs(tfm.get.room.playerList) do
  61.                 tfm.exec.movePlayer(name,152,172,false,0,0,false)
  62.             end
  63.             tfm.exec.setGameTime(temporizador)
  64.             segundos=temporizador
  65.             permitido=false
  66.             end
  67.         end
  68. end
  69.     if modo == "corrida" then
  70.         if segundos == 0 then
  71.             for name,player in pairs(tfm.get.room.playerList) do
  72.                 if player.x > 151 then
  73.                     tfm.exec.killPlayer(name)
  74.                 end
  75.             end
  76.         end
  77.         if segundos <= -1 then
  78.             if vivo == 0 then
  79.                 segundos=10
  80.                 tfm.exec.setGameTime(10)
  81.                 modo="reiniciar"
  82.                 ui.addTextArea(0,"<font size='18'><p align='center'><font face='Segoe UI'>Não houve vencedores! Próxima partida começa em "..segundos..".",nil,5,360,800,35,0x000001,0x000001,1.0,true)
  83.             elseif vivo == 1 then
  84.                 segundos=10
  85.                 tfm.exec.setGameTime(10)
  86.                 modo="reiniciar"
  87.                 ui.addTextArea(0,"<font size='18'><p align='center'><font face='Segoe UI'>Terminou a partida!",nil,5,360,800,35,0x000001,0x000001,1.0,true)
  88.             elseif vivo > 1 then
  89.                 segundos=10
  90.                 tfm.exec.setGameTime(10)
  91.                 modo="nivel"
  92.                 temporizador=temporizador-5
  93.                 nivel=nivel+1
  94.                 ui.addTextArea(0,"<font size='18'><p align='center'><font face='Segoe UI'>Nível "..nivel..": Objetivo da corrida: Até "..temporizador.." segundos.",nil,5,360,800,35,0x000001,0x000001,1.0,true)
  95.                 permitido=true
  96.             end
  97.         end
  98. end
  99.     if modo == "reiniciar" then
  100.         if segundos < 1 then
  101.             tfm.exec.newGame(mapas[math.random(#mapas)])
  102.             tfm.exec.setGameTime(60)
  103.         end
  104.     end
  105. end
  106. function eventPlayerWon(name)
  107.     tfm.exec.respawnPlayer(name)
  108.     tfm.exec.setPlayerScore(name,1,true)
  109. end
  110. function eventPlayerDied(name)
  111.     vivo=vivo-1
  112. end
  113. tfm.exec.newGame(mapas[math.random(#mapas)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement