Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Total minijuegos: 58
- ]] --[[
- Cosas por hacer ;v
- Contador
- Sistema dificultad
- ------------------------
- Minijuegos:
- Repetir una secuencia de caritas
- 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
- 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
- Llueven cajas
- ]] 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 message = ""
- local timeNewRound = os.time()
- local lastClick = {}
- local player = {info = {}}
- local killPlayers = {}
- local counterMinigames = 0
- local minigameManual = false
- 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)
- 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
- --------------- system by bolodefchoco
- local players = {room = {_count = 0}, alive = {_count = 0}, dead = {_count = 0}}
- local copy = function(list)
- local out = {}
- for k, v in next, list do out[k] = v end
- return out
- end
- local insert = function(where, playerName)
- if not where[playerName] then
- where._count = where._count + 1
- where[where._count] = playerName
- where[playerName] = where._count
- end
- end
- local remove = function(where, playerName)
- if where[playerName] then
- where._count = where._count - 1
- where[where[playerName]] = nil
- where[playerName] = nil
- end
- end
- eventNewPlayer = function(playerName)
- player.info[playerName] = {}
- system.bindMouse(playerName, true)
- teclasPlayer(playerName)
- insert(players.room, playerName)
- if gameStarted then
- insert(players.dead, playerName)
- else
- tfm.exec.respawnPlayer(playerName)
- end
- ui.addTextArea(0, "<R><font size='20'><p align='center'>" .. seconds ..
- "</R>", playerName, 378, 32, 30, 30, 0x2B2B2B, 0x121212,
- 0.7, true)
- texto =
- "\n<BV><font size='16'>Este script está en beta y <R>puede contener fallos</R>. No todo debe de funcionar correctamente."
- ui.addTextArea(666, texto, playerName, 200, 130, 400, 100, 0x2B2B2B,
- 0x121212, 1, true)
- ui.addTextArea(667,
- "<p align='center'><font size ='13' color='#00C17C'><b>Información",
- playerName, 350, 115, 100, 20, 0x2B2B2B, 0x121212, 1, true)
- ui.addTextArea(668,
- "<p align='center'><V><a href='event:cerrar'><font size='14' color='#F93018'><b>X",
- playerName, 583, 128, 0, 0, 0, 0, 1, true)
- end
- for playerName in next, tfm.get.room.playerList do eventNewPlayer(playerName) end
- eventPlayerLeft = function(playerName) remove(players.room, playerName) end
- eventPlayerDied = function(playerName)
- remove(players.alive, playerName)
- insert(players.dead, playerName)
- end
- eventPlayerRespawn = function(playerName)
- remove(players.dead, playerName)
- insert(players.alive, playerName)
- print("Agregado: " .. playerName)
- end
- eventNewGame = function()
- players.dead = {_count = 0}
- players.alive = copy(players.room)
- end
- ---------
- 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)
- if not player.info[nombre].roundWin then
- tfm.exec.chatMessage("<BV>¡Ronda completada!</BV>", nombre)
- player.info[nombre].roundWin = true
- end
- end
- stats = function()
- for nombre in pairs(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then
- 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
- -- if player.info[nombre].inRoom then
- addGender(nombre)
- -- end
- end
- end
- end
- eventMouse = function(nombre, posX, posY)
- if not players.alive[nombre] 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 players.alive[nombre] 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 nombre in pairs(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then
- if players.alive._count % 2 == 0 then
- tfm.exec.movePlayer(nombre, 200, 330)
- else
- tfm.exec.movePlayer(nombre, 600, 330)
- end
- end
- end
- end
- shuffleList = function()
- shuffled = {}
- math.randomseed(os.time())
- for nombre in pairs(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then
- local pos = math.random(1, #shuffled + 1)
- table.insert(shuffled, pos, nombre)
- end
- 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 players.alive._count % 2 > 0 then
- chooseMinigame(min, max)
- end
- end
- cleanMap = function()
- 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
- end
- newRound = function()
- counterMinigames = 0
- counterMinigames2 = 0
- gameStarted = true
- rounds = rounds + 1
- if rounds == 16 or rounds == 26 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()
- cleanMap()
- if difficulty == 0 then -- EASY
- if not minigameManual then chooseMinigame(1, 28) end
- 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
- clicksToWin = 10
- message = "¡Haz click en la pantalla <R>" .. clicksToWin ..
- "</R> veces!"
- elseif minigame == 4 then
- message = "¡Quédate MIRANDO hacia la derecha!"
- elseif minigame == 5 then
- 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
- message = "¡Baila!"
- elseif minigame == 11 then
- message = "Si mandas un mensaje, ¡mueres!"
- allWin()
- elseif minigame == 12 then
- seconds = 7
- 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 = 12
- 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>"'
- seconds = 17
- 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(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then
- tfm.exec.freezePlayer(nombre)
- end
- 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 = 410
- 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!"
- elseif minigame == 29 then
- message = "A mimir"
- elseif minigame == 30 then
- message = "Jueguen piedra papel o tijera"
- end -- end minigames dif0
- elseif difficulty == 1 then -- MEDIUM
- if not minigameManual then chooseMinigame(50, 68) end
- seconds = 10
- if minigame == 50 then
- seconds = 13
- 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 players.alive._count >= 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(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then
- player.info[nombre].explosions = 1
- end
- end
- allWin()
- elseif minigame == 67 then
- message = "¡El <R>ÚLTIMO</R> en hacer click muere!"
- for nombre in pairs(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then
- table.insert(lastClick, nombre)
- end
- end
- seconds = 6
- elseif minigame == 68 then
- message = "¡Ahora todos tienen pareja!"
- parejas()
- allWin()
- elseif minigame == 69 then
- allWin()
- seconds = 22
- 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!"
- end
- elseif difficulty == 2 then -- HARD.
- if not minigameManual then chooseMinigame(100, 107) end
- seconds = 6
- if minigame == 100 then
- seconds = 8
- 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(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then
- tfm.exec.giveCheese(nombre)
- end
- end
- elseif minigame == 107 then
- seconds = 10
- allWin()
- fuerza = 50
- message = "¡Haz click para generar <R>dos</R> explosiones!"
- for nombre in pairs(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then
- player.info[nombre].explosions = 2
- end
- end
- elseif minigame == 108 then
- allWin()
- seconds = 22
- 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 y las cajas!"
- end
- elseif difficulty == 3 then -- EXPERT
- end
- print("Minijuego: " .. minigame)
- minigameManual = false
- infoGame(message)
- end
- eventTextAreaCallback = function(id, nombre, callback)
- if callback == "cerrar" then
- for i = 666, 668 do ui.removeTextArea(i, nombre) end
- end
- if not players.alive[nombre] 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(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then
- tfm.exec.giveMeep(nombre, activo)
- end
- end
- end
- removeItem = function(myTable, key)
- for i, keyTable in ipairs(myTable) do
- if keyTable == key then table.remove(myTable, i) end
- end
- end
- rondaTerminada = function()
- if minigame == 4 then
- for nombre in pairs(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then
- if tfm.get.room.playerList[nombre].isFacingRight then
- roundWin(nombre)
- end
- end
- end
- elseif minigame == 5 then
- for nombre in pairs(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then
- if not tfm.get.room.playerList[nombre].isFacingRight then
- roundWin(nombre)
- end
- end
- end
- elseif minigame == 16 then
- contPalta = 0
- contAguacate = 0
- ui.removeTextArea(5, nil)
- ui.removeTextArea(6, nil)
- for nombre in pairs(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then
- if player.info[nombre].team == "palta" then
- contPalta = contPalta + 1
- elseif player.info[nombre].team == "aguacate" then
- contAguacate = contAguacate + 1
- end
- 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(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then
- if (player.info[nombre].team == ganadorFruta:lower()) or
- ganadorFruta == "¡Empate!" then
- roundWin(nombre)
- end
- end
- end
- elseif minigame == 22 or minigame == 59 or minigame == 103 then
- for nombre in pairs(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then
- if player.info[nombre].numero ~= numMatar and
- player.info[nombre].numero > 0 then
- roundWin(nombre)
- end
- 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(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then
- tfm.exec.freezePlayer(nombre, false)
- end
- end
- elseif minigame == 25 or minigame == 62 or minigame == 26 or minigame == 63 or
- minigame == 28 or minigame == 64 then
- for nombre in pairs(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then
- if tfm.get.room.playerList[nombre].y <= porEncimaY then
- roundWin(nombre)
- end
- end
- end
- elseif minigame == 27 then
- for nombre in pairs(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then
- if tfm.get.room.playerList[nombre].x >= porEncimaX then
- roundWin(nombre)
- end
- end
- end
- elseif minigame == 53 then
- for nombre in pairs(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then
- if tfm.get.room.playerList[nombre].movingRight then
- roundWin(nombre)
- end
- end
- end
- elseif minigame == 54 then
- for nombre in pairs(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then
- if tfm.get.room.playerList[nombre].movingLeft then
- roundWin(nombre)
- end
- end
- end
- elseif minigame == 61 or minigame == 104 then
- for nombre in pairs(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then
- if not (tfm.get.room.playerList[nombre].x - 30 > flechaX or
- tfm.get.room.playerList[nombre].x + 30 < flechaX) then
- roundWin(nombre)
- end
- 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(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then
- player.info[nombre].roundWin = false
- end
- end
- end
- end
- end
- minigame = 0
- for nombre in pairs(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then -- 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
- end
- for _, nombre in pairs(killPlayers) do -- los mata, y los elimina de playersAlive
- remove(players.alive, nombre)
- tfm.exec.killPlayer(nombre)
- end
- killPlayers = {}
- ui.removeTextArea(1, nil)
- timeNewRound = os.time()
- if players.alive._count == 1 then
- for nombre in pairs(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then
- ganador(nombre)
- end
- end
- alreadyWinner = true
- elseif players.alive._count < 1 then
- allDead = true
- ui.addTextArea(7,
- "<BV><font size='20'><p align='center'><b>¡Nadie gana! ¡Todos muertos!",
- nil, 150, 200, 500, 30, 0x2B2B2B, 0x121212, 0.7, true)
- end
- end
- eventEmotePlayed = function(nombre, idEmote, bandera)
- print(idEmote)
- if not players.alive[nombre] 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)
- elseif minigame == 29 and idEmote == 6 then
- roundWin(nombre)
- elseif minigame == 30 and idEmote == 25 or idEmote == 26 then
- roundWin(nombre)
- end
- end
- allWin = function()
- for nombre in pairs(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then
- player.info[nombre].roundWin = true
- end
- end
- end
- eventLoop = function()
- --[[ playersWin = 0
- for nombre in pairs(players.alive) do
- if nombre ~= "_count" and tonumber(nombre) == nil then
- if player.info[nombre].roundWin then
- playersWin = playersWin + 1
- end
- end
- end
- print("Vivos: " .. players.alive._count .. " PlayerWins: " .. playersWin .. " En sala: " .. players.room._count) ]]
- 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 or minigame == 69 or minigame == 108 then
- counterMinigames = counterMinigames + 1
- if counterMinigames == 1 then
- tfm.exec
- .addShamanObject(0, poscX - 7, poscY - 7, rotacion + 180)
- elseif counterMinigames >= 2 then
- spawnearCn()
- if minigame == 108 then
- counterMinigames2 = counterMinigames2 + 1
- if counterMinigames2 >= 2 then
- tfm.exec.addShamanObject(2, math.random(200, 600), 200,
- 0, 0, 0)
- counterMinigames2 = 0
- end
- end
- 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 alreadyWinner or allDead then
- newMap()
- ui.removeTextArea(7, nil)
- alreadyWinner = false
- allDead = false
- else
- newRound()
- 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]:lower():lower() == "respawn" or args[1]:lower() == "r" then
- tfm.exec.respawnPlayer(args[2] or nombre)
- elseif (args[1]:lower() == "dif" or args[1]:lower() == "dificultad" or
- args[1]:lower() == "d") and tonumber(args[2]) ~= nil then
- difficulty = tonumber(args[2])
- elseif (args[1]:lower() == "minigame" or args[1]:lower() == "m" or
- args[1]:lower() == "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
- eventKeyboard = function(nombre, key, down, posX, posY)
- if not players.alive[nombre] 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 or key == 65) 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 = 6
- 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
- minigame = 0
- cleanMap()
- stats()
- end
- newMap()
Add Comment
Please, Sign In to add comment