Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Cuando alguien viene lo toma como ALIVE [MISTAKE].
- Cosas por hacer ;v
- Contador
- Sistema dificultad
- Minijuegos:
- Repetir una secuencia de caritas
- ¡Ahora estas atado a X! [pareja]
- Tas chikito
- Transformar a alguien en vamp, alejarlo de los demas, cuando alguien más se transforme, se muera
- Abraza a alguien U//w//U r
- Cuanto es 10x10?
- Escribe !hate [nombreDeJugador] para matar al jugador mas odiado
- Cuál es el número de tu titulo? [pa hard i guess] wtf imposible SI ES POSIBLE
- Escribe el nombre de tu tribu ["Ninguno"] si no tienes
- ¿En que fecha te registraste?
- Cuántos puntos tienes?
- Saltar es mas pesado // tfm.exec.movePlayer(name, 0, 0, true, 0, 100, true)
- cuantos ratones vivos quedan?
- Cómo se llama la sala?
- TP JUSTO AL FINAL DE TODO EL MAPA
- portal quieto, y Portal moviendose,
- cañon te empuja a algun lado
- hielo en el centro, lava, dar meeps
- VER Minijuego 66 ;v es una shit?
- /module playground
- PONER QUE SE DESACTIVE MEEP AL INICIAR NUEVO MAPA, player.info[nombre].alive = true TAMBIÉN
- ]]
- local admin = {
- ['Blood#3565'] = true,
- ['His#0439'] = true,
- ['Alditohacker#0000'] = true,
- ['Fafee#0000'] = true
- }
- local counter = 0
- local seconds = 20
- local rounds = 0
- local difficulty = 0
- local playersAlive = {}
- local message = ""
- local timeNewRound = os.time()
- local lastClick = {}
- local player = {info = {}}
- local killPlayers = {}
- local counterMinigames = 0
- local minigameManual = false
- --local timeNewRound = os.time() + 15000 -- Empieza con 15s (+5s que tarda en iniciar la ronda) extras
- local frases = {"Fafee es el mejor Funcorp", "Esternocleidomastoideo", "Electroencefalografia", "Fafee es el peor Funcorp", "Up: 368 W: 0 Z: 0"}
- local numMatar = 0
- local movIzq = false
- local posPortalX = {550, 600, 650, 100, 150, 200, 250, 300, 350, 400, 450, 550}
- local gameStarted = false
- tfm.exec.disableAutoNewGame()
- tfm.exec.disableAutoShaman()
- tfm.exec.disableAutoTimeLeft()
- tfm.exec.disablePhysicalConsumables()
- tfm.exec.disableAutoScore()
- tfm.exec.disableAfkDeath(true)
- --ui.addTextArea(0, "<R><font size='20'><p align='center'>" .. seconds .. "</R>", nil, 378, 32, 30, 30, 0x2B2B2B, 0x121212, 0.7, true) -- Tiempo
- addGender = function(nombre)
- if tfm.get.room.playerList[nombre].gender == 2 then
- player.info[nombre].genero = "masculino"
- elseif tfm.get.room.playerList[nombre].gender == 1 then
- player.info[nombre].genero = "femenino"
- else
- player.info[nombre].genero = "ninguno"
- end
- end
- roundWin = function(nombre)
- tfm.exec.chatMessage("<BV>¡Ronda completada!</BV>", nombre)
- player.info[nombre].roundWin = true
- end
- stats = function()
- for _, nombre in pairs(playersAlive) do
- player.info[nombre].roundWin = false
- player.info[nombre].clicks = 0
- player.info[nombre].explosions = 0
- player.info[nombre].countE = 0
- player.info[nombre].team = ""
- player.info[nombre].clicksTextareas = 0
- player.info[nombre].numero = 0
- addGender(nombre)
- end
- end
- teclasPlayer = function (nombre)
- tfm.exec.bindKeyboard(nombre, 37, true, true) -- Arrow Left
- tfm.exec.bindKeyboard(nombre, 38, true, true) -- Arrow UP
- tfm.exec.bindKeyboard(nombre, 39, true, true) -- Arrow Right
- tfm.exec.bindKeyboard(nombre, 40, true, true) -- Arrow Down
- tfm.exec.bindKeyboard(nombre, 83, true, true) -- S
- tfm.exec.bindKeyboard(nombre, 87, true, true) -- W
- tfm.exec.bindKeyboard(nombre, 65, true, true) -- A
- tfm.exec.bindKeyboard(nombre, 68, true, true) -- D
- tfm.exec.bindKeyboard(nombre, 69, true, true) -- E
- --tfm.exec.bindKeyboard(nombre, 81, true, true) -- Q
- --tfm.exec.bindKeyboard(nombre, 90, true, true) -- Z
- end
- eventNewPlayer = function (nombre)
- player.info[nombre] = {}
- stats()
- system.bindMouse(nombre, true)
- teclasPlayer(nombre)
- player.info[nombre].inRoom = true
- if not gameStarted then
- tfm.exec.respawnPlayer(nombre)
- end
- ui.addTextArea(0, "<R><font size='20'><p align='center'>" .. seconds .. "</R>", nombre, 378, 32, 30, 30, 0x2B2B2B, 0x121212, 0.7, true)
- end
- for i, k in pairs(tfm.get.room.playerList) do
- eventNewPlayer(i)
- end
- eventMouse = function (nombre, posX, posY)
- if not player.info[nombre].alive then return end
- if minigame == 3 or minigame == 58 then
- player.info[nombre].clicks = player.info[nombre].clicks + 1
- if player.info[nombre].clicks >= clicksToWin then
- roundWin(nombre)
- end
- elseif (minigame == 66 or minigame == 107) and player.info[nombre].explosions > 0 then
- tfm.exec.explosion (posX, posY, fuerza, 50, true)
- tfm.exec.displayParticle (10, posX, posY)
- player.info[nombre].explosions = player.info[nombre].explosions - 1
- elseif (minigame == 67 and #lastClick > 1) or (minigame == 107 and #lastClick > 2) then
- removeItem(lastClick, nombre)
- roundWin(nombre)
- end
- end
- infoGame = function (message)
- ui.addTextArea(1, "<BV><font size='20'><p align='center'><b>" .. message .."</BV></b>", nil, 150, 360, 500, 30, 0x2B2B2B, 0x121212, 0.9, true)
- end
- eventChatMessage = function (nombre, mensaje)
- if not player.info[nombre].alive then return end
- if minigame == 1 then
- if mensaje:lower() == player.info[nombre].genero then
- roundWin(nombre)
- end
- elseif minigame == 11 or minigame == 56 then
- tfm.exec.killPlayer(nombre)
- elseif (minigame == 15 or minigame == 50 or minigame == 100) and mensaje == tostring(numeroMinigame) then
- roundWin(nombre)
- elseif minigame == 18 and mensaje == "2010" then
- roundWin(nombre)
- elseif minigame == 21 and mensaje:lower() == frases[frase]:lower() then
- roundWin(nombre)
- elseif (minigame == 22 or minigame == 59 or minigame == 103) and tonumber(mensaje) and tonumber(mensaje) > 0 and tonumber(mensaje) <= numMatarMax then
- player.info[nombre].numero = tonumber(mensaje)
- end
- end
- saberDificultad = function ()
- if difficulty == 0 then
- return "<PT>Fácil</PT>"
- elseif difficulty == 1 then
- return "<A:ACTIVE>Medio</A:ACTIVE>"
- elseif difficulty == 2 then
- return "<R>Difícil</R>"
- elseif difficulty == 3 then
- return "<font color='#F93018'>Experto</font>"
- end
- end
- clickTextareas = function ()
- for i = 100, cantidad + 100 do
- ui.addTextArea(i, "<BV><font size='34'><p align='center'><a href='event:clicksTextarea'>•</BV>", nil, math.random(20, 780), math.random(50, 300), 0, 0, 0, 0, 0, true)
- end
- end
- tpEsquinas = function()
- for i, nombre in pairs(playersAlive) do
- if i % 2 == 0 then
- tfm.exec.movePlayer(nombre, 200, 330)
- else
- tfm.exec.movePlayer(nombre, 600, 330)
- end
- end
- end
- shuffleList = function()
- shuffled = {}
- math.randomseed(os.time())
- for i, v in ipairs(playersAlive) do
- local pos = math.random(1, #shuffled+1)
- table.insert(shuffled, pos, v)
- end
- return shuffled
- end
- parejas = function()
- local list = shuffleList() -- randomiza playersAlive
- local l = #list
- local i=1
- while i<= l do
- tfm.exec.linkMice(list[i], list[i+1], true)
- i = i + 2
- end
- end
- chooseMinigame = function(min, max)
- minigame = math.random(min, max)
- if (minigame == 68) and #playersAlive % 2 > 0 then
- chooseMinigame(min, max)
- end
- end
- newRound = function()
- counterMinigames = 0
- gameStarted = true
- rounds = rounds + 1
- if rounds == 11 or rounds == 21 or rounds == 30 or rounds == 50 then -- En las rondas 5, 10, 20 y 30 aumenta la difcultad
- difficulty = difficulty + 1
- end
- ui.setMapName ("<N>Dificultad: </N>" .. saberDificultad() .. " <G>|</G> <N>Ronda: </N><BV>" .. rounds)
- stats()
- --difficulty = 0
- for i = 100, 130 do -- remove all
- ui.removeTextArea(i, nil)
- end
- ui.removeTextArea(7, nil) -- remove ganador palta/aguacate
- for i = 66, 69 do
- tfm.exec.removePhysicObject(i)
- end
- tfm.exec.addShamanObject(26, 400, 400) -- portales
- tfm.exec.addShamanObject(27, 400, 400) -- portales
- if difficulty == 0 then -- EASY
- if not minigameManual then
- chooseMinigame(1, 28)
- end
- --minigame = 20
- seconds = 10
- if minigame == 1 then
- message = "Escribe el género de tu perfil"
- elseif minigame == 2 then
- message = "¡Esquiva la lava!"
- lavaW = 30
- lavaH = 25
- cantidadLava = 2
- allWin()
- elseif minigame == 3 then
- seconds = seconds - 2
- clicksToWin = 10
- message = "¡Haz click en la pantalla <R>" .. clicksToWin .. "</R> veces!"
- elseif minigame == 4 then
- seconds = seconds - 4
- message = "¡Quédate MIRANDO hacia la derecha!"
- elseif minigame == 5 then
- seconds = seconds - 4
- message = "¡Quédate MIRANDO hacia la izquierda!"
- elseif minigame == 6 then
- message= "¡Agachate para cavar tu tumba!"
- allWin()
- elseif minigame == 7 then
- message = "¡No saltes!"
- allWin()
- elseif minigame == 8 then
- message = "¡No te muevas!"
- allWin()
- elseif minigame == 9 then
- message = "Lanza confeti 5 veces"
- elseif minigame == 10 then
- seconds = 6
- message = "¡Baila!"
- elseif minigame == 11 then
- message = "Si mandas un mensaje, ¡mueres!"
- allWin()
- elseif minigame == 12 then
- seconds = 6
- message = "¡Todos tienen meep!"
- allWin()
- meep(true)
- elseif minigame == 13 then
- message = "¡No te muevas hacia la derecha!"
- allWin()
- elseif minigame == 14 then
- message = "¡No te muevas hacia la izquierda!"
- allWin()
- elseif minigame == 15 then
- numeroMinigame = math.random(1000000, 10000000)
- message = "Escribe este numero: <R>" .. numeroMinigame .. "</R>"
- elseif minigame == 16 then
- message = "¿Palta o Aguacate? ¡Morirá el peor equipo!"
- ui.addTextArea(5, "<A:ACTIVE><font size='16'><p align='center'><a href='event:palta'><b>Palta</a></PT>", nil, 140, 160, 0, 30, 0x2B2B2B, 0x121212, 0.7, true)
- ui.addTextArea(6, "<A:ACTIVE><font size='16'><p align='center'><a href='event:aguacate'><b>Aguacate</a></PT>", nil, 600, 160, 0, 30, 0x2B2B2B, 0x121212, 0.7, true)
- elseif minigame == 17 then
- message = "¡Haz click en todos los puntos!"
- seconds = 16
- cantidad = 10
- clickTextareas(cantidad)
- elseif minigame == 18 then
- message = "¿En qué año se publicó Transformice?"
- elseif minigame == 19 then
- message = "¡Pon la bandera de Argentina!"
- elseif minigame == 20 then
- allWin()
- seconds = 26
- poscX, poscY, rotacion = math.random(10,790), math.random(150, 300), math.random(90, 120)
- if poscX >= 400 then
- rotacion = rotacion * -1
- end
- message = "¡Esquiva los cañones!"
- elseif minigame == 21 then
- frase = math.random(1, #frases)
- message = 'Escribe: "<R>' .. frases[frase] .. '</R>"'
- elseif minigame == 22 then
- numMatarMax = 10
- numMatar = math.random(1, numMatarMax)
- message = "Escribe un número del <R>1</R> al <R>" .. numMatarMax .. "</R>"
- elseif minigame == 23 then
- message = "¡Pon la bandera de Chile!"
- elseif minigame == 24 then
- message = "¡Todos congelados!"
- for _, nombre in pairs (playersAlive) do
- tfm.exec.freezePlayer(nombre)
- end
- allWin()
- elseif minigame == 25 then
- tpEsquinas()
- tfm.exec.addPhysicObject(66, 400, 311, {type = 1, width = 40, height = 48, friction = 0, restitution = 0.3, miceCollision = true, groundCollision = false, dynamic = false})
- message = "¡Quédate encima del hielo!"
- porEncimaY = 273
- elseif minigame == 26 then
- message = "<font size='18'>¡Termina el mapa por encima de la línea roja!</font>"
- ui.addTextArea(7, "", nil, 5, 210, 790, 12, 0xCA2020, 0xCA2020, 1, true)
- tfm.exec.addShamanObject(26, 600, 50)
- tfm.exec.addShamanObject(27, 200, 314)
- porEncimaY = 210
- elseif minigame == 27 then
- message = "<font size='18'>¡Mantente a la derecha de la línea roja!</font>"
- ui.addTextArea(7, "", nil, 388, 72, 12, 330, 0xCA2020, 0xCA2020, 1, true)
- porEncimaX = 402
- elseif minigame == 28 then
- tfm.exec.addShamanObject(26, 550, 195)
- tfm.exec.addShamanObject(27, 200, 314)
- tfm.exec.addPhysicObject(66, 500, 200, {type = 1, width = 40, height = 50, friction = 0, restitution = 0.2, miceCollision = true, groundCollision = false, dynamic = false})
- porEncimaY = 160
- message = "¡Quédate encima del hielo!"
- end -- end minigames dif0
- elseif difficulty == 1 then -- MEDIUM
- if not minigameManual then
- chooseMinigame(50, 64)
- end
- -- minigame = 64
- seconds = 10
- if minigame == 50 then
- numeroMinigame = math.random(1000000000, 10000000000) * 107
- message = "Escribe este numero: <R>" .. numeroMinigame .. "</R>"
- elseif minigame == 51 then
- message = "¡Esquiva la lava!"
- lavaW = 50
- lavaH = 25
- cantidadLava = 4
- allWin()
- elseif minigame == 52 then
- message = "¡Haz click en todos los puntos!"
- seconds = 21
- cantidad = 20
- clickTextareas(cantidad)
- elseif minigame == 53 then
- message = "¡Quédate CAMINANDO hacia la derecha!"
- elseif minigame == 54 then
- message = "¡Quédate CAMINANDO hacia la izquierda!"
- elseif minigame == 55 then
- message = "¡Salta en los últimos DOS segundos!"
- elseif minigame == 56 then
- message = "Si mandas un mensaje, ¡mueres!"
- allWin()
- elseif minigame == 57 then
- message = "¡Eres más rápido hacia la izquierda!"
- movIzq = true
- allWin()
- elseif minigame == 58 then
- clicksToWin = 20
- message = "¡Haz click en la pantalla <R>" .. clicksToWin .. "</R> veces!"
- elseif minigame == 59 then
- numMatarMax = 7
- numMatar = math.random(1, numMatarMax)
- message = "Escribe un número del <R>1</R> al <R>" .. numMatarMax .. "</R>"
- elseif minigame == 60 then
- message = "¡Empuja la caja fuera del mapa!"
- seconds = 15
- tfm.exec.addShamanObject (2, math.random(200,600), 200, 0, 0, 0)
- if #playersAlive >= 4 then
- tfm.exec.addShamanObject (2, math.random(200,600), 200, 0, 0, 0)
- end
- elseif minigame == 61 then
- seconds = 5
- message = "¡Ven aquí!"
- flechaX = math.random(150, 650)
- tfm.exec.addShamanObject (0, flechaX, 285, 0, 0, 0)
- elseif minigame == 62 then
- tpEsquinas()
- tfm.exec.addPhysicObject(66, 400, 311, {type = 1, width = 40, height = 48, friction = 0, restitution = 0.3, miceCollision = true, groundCollision = false, dynamic = false})
- tfm.exec.addPhysicObject(67, 400, 265, {type = 1, width = 20, height = 44, friction = 0, restitution = 0.3, miceCollision = true, groundCollision = false, dynamic = false})
- message = "¡Quedate encima del último hielo!"
- porEncimaY = 230
- elseif minigame == 63 then
- message = "<font size='18'>¡Termina el mapa por encima de la línea roja!</font>"
- ui.addTextArea(7, "", nil, 5, 150, 790, 12, 0xCA2020, 0xCA2020, 1, true)
- tfm.exec.addShamanObject(26, 600, 50)
- tfm.exec.addShamanObject(27, 200, 314)
- porEncimaY = 141
- elseif minigame == 64 then
- seconds = 14
- tfm.exec.addShamanObject(26, 200, 314)
- tfm.exec.addPhysicObject(66, 500, 200, {type = 1, width = 40, height = 50, friction = 0, restitution = 0.2, miceCollision = true, groundCollision = false, dynamic = false})
- porEncimaY = 161
- cont = 1
- message = "¡Quédate encima del hielo!"
- elseif minigame == 65 then
- seconds = 16
- message = "¡Esquiva los yunques o muere!"
- tfm.exec.addShamanObject (0, 690, 300, 80, 0, 0)
- allWin()
- elseif minigame == 66 then
- fuerza = 50
- message = "¡Haz click para generar <R>una</R> explosión!"
- for _, nombre in pairs (playersAlive) do
- player.info[nombre].explosions = 1
- end
- elseif minigame == 67 then
- message = "¡El <R>ÚLTIMO</R> en hacer click muere!"
- for _, nombre in pairs (playersAlive) do
- table.insert(lastClick, nombre)
- end
- elseif minigame == 68 then
- message = "¡Ahora todos tienen pareja!"
- parejas()
- allWin()
- end
- elseif difficulty == 2 then -- HARD.
- if not minigameManual then
- chooseMinigame(100, 107)
- end
- seconds = 6
- if minigame == 100 then
- numeroMinigame = math.random(5000000000, 10000000001) * 10007
- message = "Escribe este numero: <R>" .. numeroMinigame .. "</R>"
- elseif minigame == 101 then
- message = "¡Haz click en todos los puntos!"
- seconds = 21
- cantidad = 30
- clickTextareas(cantidad)
- elseif minigame == 102 then
- seconds = 21
- message = "¡Esquiva la lava!"
- lavaW = 70
- lavaH = 25
- cantidadLava = 5
- allWin()
- elseif minigame == 103 then
- numMatarMax = 5
- numMatar = math.random(1, numMatarMax)
- message = "Escribe un número del <R>1</R> al <R>" .. numMatarMax .. "</R>"
- elseif minigame == 104 then
- seconds = 11
- message = "¡Ven aquí y esquiva la lava!"
- lavaW = 40
- lavaH = 25
- cantidadLava = 3
- flechaX = math.random(150, 650)
- tfm.exec.addShamanObject (0, flechaX, 285, 0, 0, 0)
- elseif minigame == 105 then
- message = "¡Salta en el <R>ÚLTIMO</R> segundos!"
- elseif minigame == 106 then
- message = "¡Ahora TODOS tienen queso!"
- allWin()
- for _, nombre in pairs (playersAlive) do
- tfm.exec.giveCheese(nombre)
- end
- elseif minigame == 107 then
- seconds = 10
- allWin()
- fuerza = 50
- message = "¡Haz click para generar <R>dos</R> explosiones!"
- for _, nombre in pairs (playersAlive) do
- player.info[nombre].explosions = 2
- end
- elseif minigame == 108 then
- --message = "¡Los "
- end
- elseif difficulty == 3 then -- EXPERT
- end
- minigameManual = false
- infoGame(message)
- end
- eventTextAreaCallback = function (id, nombre, callback)
- if not player.info[nombre].alive then return end
- if minigame == 16 then
- if callback == "palta" then
- player.info[nombre].team = "palta"
- tfm.exec.chatMessage("¡Ahora estás en el equipo Palta!", nombre)
- else
- player.info[nombre].team = "aguacate"
- tfm.exec.chatMessage("¡Ahora estás en el equipo Aguacate!", nombre)
- end
- elseif minigame == 17 or minigame == 52 or minigame == 101 then
- if callback == 'clicksTextarea' then
- ui.removeTextArea(id, nombre)
- player.info[nombre].clicksTextareas = player.info[nombre].clicksTextareas + 1
- if player.info[nombre].clicksTextareas >= cantidad then
- roundWin(nombre)
- end
- end
- end
- end
- meep = function(activo)
- for _, nombre in pairs(playersAlive) do
- tfm.exec.giveMeep(nombre, activo)
- end
- end
- removeItem = function (myTable, key)
- for i, keyTable in ipairs(myTable) do
- if keyTable == key then
- table.remove(myTable, i)
- return
- end
- end
- end
- rondaTerminada = function ()
- if minigame == 4 then
- for _, nombre in pairs(playersAlive) do
- if tfm.get.room.playerList[nombre].isFacingRight then
- roundWin(nombre)
- end
- end
- elseif minigame == 5 then
- for _, nombre in pairs(playersAlive) do
- if not tfm.get.room.playerList[nombre].isFacingRight then
- roundWin(nombre)
- end
- end
- elseif minigame == 16 then
- contPalta = 0
- contAguacate = 0
- ui.removeTextArea(5, nil)
- ui.removeTextArea(6, nil)
- for _, nombre in pairs(playersAlive) do
- if player.info[nombre].team == "palta" then
- contPalta = contPalta + 1
- elseif player.info[nombre].team == "aguacate" then
- contAguacate = contAguacate + 1
- end
- end
- if contPalta > contAguacate then
- ganadorFruta = "Palta"
- elseif contPalta < contAguacate then
- ganadorFruta = "Aguacate"
- else
- ganadorFruta = "¡Empate!"
- end
- ui.addTextArea(7, "<BV><font size='20'><p align='center'><b>El ganador es: <R>" .. ganadorFruta .. "</R></BV>", nil, 150, 360, 500, 30, 0x2B2B2B, 0x121212, 0.7, true)
- for _, nombre in pairs(playersAlive) do
- if (player.info[nombre].team == ganadorFruta:lower()) or ganadorFruta == "¡Empate!" then
- roundWin(nombre)
- end
- end
- elseif minigame == 22 or minigame == 59 or minigame == 103 then
- for _, nombre in pairs(playersAlive) do
- if player.info[nombre].numero ~= numMatar and player.info[nombre].numero > 0 then
- roundWin(nombre)
- end
- end
- ui.addTextArea(7, "<BV><font size='20'><p align='center'><b>¡Todos los números<R> " .. numMatar .. " </R>moriran!</BV>", nil, 150, 360, 500, 30, 0x2B2B2B, 0x121212, 0.7, true)
- elseif minigame == 24 then
- for _, nombre in pairs(playersAlive) do
- tfm.exec.freezePlayer(nombre, false)
- end
- elseif minigame == 25 or minigame == 62 or minigame == 26 or minigame == 63 or minigame == 28 or minigame == 64 then
- for _, nombre in pairs(playersAlive) do
- if tfm.get.room.playerList[nombre].y <= porEncimaY then
- roundWin(nombre)
- end
- end
- elseif minigame == 27 then
- for _, nombre in pairs(playersAlive) do
- if tfm.get.room.playerList[nombre].x >= porEncimaX then
- roundWin(nombre)
- end
- end
- elseif minigame == 53 then
- for _, nombre in pairs(playersAlive) do
- if tfm.get.room.playerList[nombre].movingRight then
- roundWin(nombre)
- end
- end
- elseif minigame == 54 then
- for _, nombre in pairs(playersAlive) do
- if tfm.get.room.playerList[nombre].movingLeft then
- roundWin(nombre)
- end
- end
- elseif minigame == 61 or minigame == 104 then
- for _, nombre in pairs(playersAlive) do
- if not (tfm.get.room.playerList[nombre].x - 30 > flechaX or tfm.get.room.playerList[nombre].x + 30 < flechaX) then
- roundWin(nombre)
- end
- end
- elseif minigame == 60 then
- for _, k in pairs (tfm.get.room.objectList) do
- if (k.type == 2) and (k.y < 310 == false) then
- allWin()
- else
- for _, nombre in pairs(playersAlive) do
- player.info[nombre].roundWin = false
- end
- end
- end
- end
- minigame = 999
- for _, nombre in pairs(playersAlive) do -- agregar al array kilLPlayers todos los jugadores que no hayan termiando la ronda.
- if not player.info[nombre].roundWin then
- table.insert(killPlayers, nombre)
- end
- end
- for _, nombre in pairs(killPlayers) do -- los mata, y los elimina de playersAlive
- tfm.exec.killPlayer(nombre)
- removeItem(playersAlive, nombre)
- end
- killPlayers = {}
- ui.removeTextArea(1, nil)
- timeNewRound = os.time()
- if #playersAlive == 1 then
- ganador(playersAlive[1])
- alreadyWinner = true
- elseif #playersAlive < 1 then
- print("Todos muertos")
- newMap()
- end
- end
- eventEmotePlayed = function(nombre, idEmote, bandera)
- if not player.info[nombre].alive then return end
- if minigame == 10 and idEmote == 0 then
- roundWin(nombre)
- elseif minigame == 19 and idEmote == 10 and bandera == "ar" then
- roundWin(nombre)
- elseif minigame == 23 and idEmote == 10 and bandera == "cl" then
- roundWin(nombre)
- end
- end
- eventPlayerDied = function(nombre)
- if gameStarted then
- removeItem(playersAlive, nombre)
- player.info[nombre].alive = false
- end
- end
- eventPlayerLeft = function(nombre)
- if not gameStarted then
- player.info[nombre].inRoom = false
- removeItem(playersAlive, nombre)
- player.info[nombre].alive = false
- end
- end
- allWin = function()
- for i, k in pairs(playersAlive) do
- player.info[k].roundWin = true
- end
- end
- eventLoop = function ()
- -- print(tfm.get.room.playerList["His#0439"].y)
- print("Vivos: " .. #playersAlive)
- counter = counter + 1 -- cada 0.5s el contador aumenta en 1
- if counter >= 2 and seconds > 0 then -- si pasó 1s entonces..
- seconds = seconds - 1 -- se resta 1s
- ui.updateTextArea(0, "<R><font size='20'><p align='center'>" .. seconds .. "</R>", nil) -- se actualiza el textarea
- counter = 0
- if minigame == 2 or minigame == 51 or minigame == 102 or minigame == 104 then
- counterMinigames = counterMinigames + 1
- if counterMinigames >= 3 then
- for k = 1, cantidadLava do
- rainLava(k, lavaW, lavaH)
- end
- counterMinigames = 0
- end
- elseif minigame == 20 then
- counterMinigames = counterMinigames + 1
- if counterMinigames == 1 then
- tfm.exec.addShamanObject(0, poscX-7, poscY-7, rotacion + 180)
- elseif counterMinigames >= 2 then
- spawnearCn()
- end
- elseif minigame == 64 then
- tfm.exec.addShamanObject(27, posPortalX[cont], 195)
- cont = cont + 1
- elseif minigame == 65 then
- counterMinigames = counterMinigames + 1
- if counterMinigames >= 3 then
- tfm.exec.addShamanObject(10, 670, 300, -10, -20)
- counterMinigames = 0
- end
- end
- if seconds == 0 then
- rondaTerminada()
- end
- end
- if timeNewRound < os.time() - 5000 then
- timeNewRound = 9999999999999
- if not alreadyWinner then
- newRound()
- else
- newMap()
- ui.removeTextArea(7, nil)
- alreadyWinner = false
- end
- end
- end
- spawnearCn = function ()
- tfm.exec.addShamanObject(math.random(1701,1714), poscX, poscY, rotacion, 10, 10)
- counterMinigames = 0
- poscX, poscY, rotacion = math.random(10,790), math.random(150, 300), math.random(90, 120)
- if poscX >= 400 then
- rotacion = rotacion * -1
- end
- end
- rainLava = function(id, lavaWidht, lavaHeigth)
- tfm.exec.addPhysicObject(id, math.random(130, 670), 0, {
- type = 3,
- width = lavaWidht,
- height = lavaHeigth,
- friction = 0.2,
- angle = math.random(10,80),
- restitution = 9999,
- miceCollision = true,
- groundCollision = false,
- dynamic = true,
- fixedRotation = true,
- mass = 10,
- linearDamping = 1
- })
- end
- eventChatCommand = function(nombre, comando)
- if not admin[nombre] then return end
- local args={}
- for argument in comando:gmatch("[^%s]+") do
- table.insert(args,argument)
- end
- if args[1] == "respawn" or args[1] == "r" then
- tfm.exec.respawnPlayer(args[2] or nombre)
- elseif (args[1] == "dif" or args[1] == "dificultad" or args[1] == "d") and tonumber(args[2]) ~= nil then
- difficulty = tonumber(args[2])
- elseif (args[1] == "minigame" or args[1] == "m" or args[1] == "minijuego") and tonumber(args[2]) ~= nil then
- minigame = tonumber(args[2])
- minigameManual = true
- -- Se coloca automaticamente la dificultad del minijuego en concreto:
- if minigame >= 1 and minigame < 50 then
- difficulty = 0
- elseif minigame >= 50 and minigame < 100 then
- difficulty = 1
- elseif minigame >= 100 and minigame < 150 then
- difficulty = 2
- elseif minigame >= 150 and minigame < 200 then
- difficulty = 3
- end
- timeNewRound = 9999999999999
- newRound()
- end
- end
- eventPlayerRespawn = function(nombre)
- table.insert(playersAlive, nombre)
- player.info[nombre].alive = true
- end
- eventKeyboard = function(nombre, key, down, posX, posY)
- if not player.info[nombre].alive then return end
- if (minigame == 6) and (key == 40 or key == 83) and (not tfm.get.room.playerList[nombre].isDead) then -- Se coloca entre () la primera condición para que si alguna de las dos es true pase a la siguiente.
- tfm.exec.killPlayer(nombre)
- tfm.exec.addShamanObject(90, posX, posY)
- elseif (minigame == 7) and (key == 38 or key == 87 or key == 90) then
- tfm.exec.killPlayer(nombre)
- elseif (minigame == 8) and (key == 38 or key == 39 or key == 37 or key == 87 or key == 90 or key == 40 or key == 83 or key == 65 or key == 68 or key == 81) then
- tfm.exec.killPlayer(nombre)
- elseif minigame == 9 and key == 69 then
- player.info[nombre].countE = player.info[nombre].countE + 1
- if player.info[nombre].countE >= 5 then
- roundWin(nombre)
- end
- elseif movIzq and (key == 37 or key == 65 or key == 81) then
- tfm.exec.movePlayer(nombre, 0, 0, true, -50, 0, true)
- elseif (minigame == 13) and (key == 39 or key == 68) then
- tfm.exec.killPlayer(nombre)
- elseif (minigame == 14) and (key == 37 or key == 81) then
- tfm.exec.killPlayer(nombre)
- elseif minigame == 55 and (key == 38 or key == 87 or key == 90) then
- if seconds <= 2 then
- roundWin(nombre)
- else
- tfm.exec.killPlayer(nombre)
- end
- elseif minigame == 105 and (key == 38 or key == 87 or key == 90) then
- if seconds <= 1 then
- roundWin(nombre)
- else
- tfm.exec.killPlayer(nombre)
- end
- end
- end
- ganador = function(nombre)
- ui.addTextArea(7, "<BV><font size='20'><p align='center'><b>¡<R>" .. nombre .. "</R> ganó la partida!", nil, 150, 200, 500, 30, 0x2B2B2B, 0x121212, 0.7, true)
- tfm.exec.setPlayerScore(nombre, 1, true)
- end
- newMap = function()
- counter = 0
- seconds = 20
- rounds = 0
- difficulty = 0
- timeNewRound = os.time() + 15000 -- Empieza con 15s (+5s que tarda en iniciar la ronda) extras
- lastClick = {}
- tfm.exec.newGame('7773692')
- tfm.exec.setGameTime(100000)
- gameStarted = false
- playersAlive = {}
- for nombre in pairs(tfm.get.room.playerList) do
- if player.info[nombre].inRoom then
- table.insert(playersAlive, nombre)
- player.info[nombre].alive = true
- end
- end
- print("desde newMap: " .. #playersAlive)
- end
- newMap()
- -- MAYBE AGREGAR, BOMBAS CON ESPACIO:
- --[[
- local toDespawn = {}
- local mice = {}
- local countdownBomb = 2000 -- Segundos para poder colocar otra bomba
- local countDownExplode = 1000 -- Segundos para que explote la bomba.
- local power = 100 -- Fuerza con la que empujará a las ratas.
- local area = 60 -- Área de empuje
- local miceOnly = false -- Cambiar a "true" (sin las comillas) en caso de que quieras que los objetos en la sala no se muevan
- function main()
- table.foreach(tfm.get.room.playerList, eventNewPlayer)
- end
- function eventNewPlayer(name)
- if not mice[name] then
- mice[name] = {
- timeStamp = os.time()
- }
- end
- tfm.exec.bindKeyboard(name, 32, true, true)
- end
- function eventLoop(time, remaining)
- for i, bomb in ipairs(toDespawn) do
- if bomb[1] <= os.time() - countDownExplode then
- local x = tfm.get.room.objectList[bomb[2]]--.x
- -- local y = tfm.get.room.objectList[bomb[2]]--.y
- --[[
- tfm.exec.removeObject(bomb[2])
- table.remove(toDespawn, i)
- tfm.exec.explosion(x, y, power, area, miceOnly)
- end
- end
- end
- function eventKeyboard(name, key, down, x, y)
- if mice[name].timeStamp < os.time() - countdownBomb then
- local bomb = tfm.exec.addShamanObject(23, x, y)
- mice[name].timeStamp = os.time()
- table.insert(toDespawn, {os.time(), bomb})
- end
- end
- main()
- ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement