Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoScore(true)
- tfm.exec.disableAutoTimeLeft(true)
- mapas={7059252,7060029,7060037}
- temporizador=60
- modo="desativado"
- vivo=0
- nivel=0
- permitido=false
- function eventNewPlayer(name)
- 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)
- end
- function eventChatCommand(name,message)
- if name == "Jhinsword350" then
- if message == "bugar" then
- system.exit()
- end
- if message == "run" then
- tfm.exec.newGame(mapas[math.random(#mapas)])
- end
- if(message:sub(1,5) == "rodar") then
- tfm.exec.newGame(message:sub(7)
- end
- end
- end
- function eventNewGame()
- nivel=0
- modo="desativado"
- tfm.exec.setGameTime(60)
- temporizador=65
- for name,player in pairs(tfm.get.room.playerList) do
- vivo=vivo+1
- tfm.exec.setPlayerScore(name,0,false)
- end
- end
- function eventLoop(passado,tempo)
- tfm.exec.setUIMapName("MiceTona! <R>BETA<J> Criado por Jhinsword350 e Jessiewind26")
- local segundos=math.floor(tempo/1000)
- if modo == "desativado" and segundos >= 1 then
- 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)
- end
- if modo == "desativado" and segundos == 0 then
- segundos=10
- tfm.exec.setGameTime(10)
- modo="nivel"
- temporizador=temporizador-5
- nivel=nivel+1
- 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)
- permitido=true
- end
- if modo == "nivel" then
- if segundos < 4 then
- ui.addTextArea(0,"<font size='99'><font color='#000000'><font face='Segoe UI'>"..segundos.."",nil,90,10,120,120,0,0,1.0,true)
- end
- if segundos < 1 then
- if permitido == true then
- modo="corrida"
- 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)
- for name,player in pairs(tfm.get.room.playerList) do
- tfm.exec.movePlayer(name,152,172,false,0,0,false)
- end
- tfm.exec.setGameTime(temporizador)
- segundos=temporizador
- permitido=false
- end
- end
- end
- if modo == "corrida" then
- if segundos == 0 then
- for name,player in pairs(tfm.get.room.playerList) do
- if player.x > 151 then
- tfm.exec.killPlayer(name)
- end
- end
- end
- if segundos <= -1 then
- if vivo == 0 then
- segundos=10
- tfm.exec.setGameTime(10)
- modo="reiniciar"
- 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)
- elseif vivo == 1 then
- segundos=10
- tfm.exec.setGameTime(10)
- modo="reiniciar"
- 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)
- elseif vivo > 1 then
- segundos=10
- tfm.exec.setGameTime(10)
- modo="nivel"
- temporizador=temporizador-5
- nivel=nivel+1
- 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)
- permitido=true
- end
- end
- end
- if modo == "reiniciar" then
- if segundos < 1 then
- tfm.exec.newGame(mapas[math.random(#mapas)])
- tfm.exec.setGameTime(60)
- end
- end
- end
- function eventPlayerWon(name)
- tfm.exec.respawnPlayer(name)
- tfm.exec.setPlayerScore(name,1,true)
- end
- function eventPlayerDied(name)
- vivo=vivo-1
- end
- tfm.exec.newGame(mapas[math.random(#mapas)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement