Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- cuando ponen !copiarhistorial que no se abra el historial, explosion personalizada, tamaño funcorp
- local adm = {
- ['Blood#3565'] = true,
- ['Anto#6095'] = true,
- ['His#0439'] = true,
- ['Alditohacker#0000'] = true,
- ['Beckham#0977'] = true,
- ['Kiwi#8872'] = true,
- ['Noob#5388'] = true,
- ['Misterthepro#0000'] = true,
- ['Edudekarly#3398'] = true,
- ['Ansatsu#0368'] = true}
- local fly = {}
- local speed = {}
- respawn = true
- args = {}
- historialMapas = {}
- historial = {}
- historialActivos = {}
- recordsActivos = {}
- times = {}
- comandosUsados = {}
- categoria = '#13'
- mapVanilla = 0
- player = {info = {checkpoint = {}}, poderes = {}}
- checkpoints = false
- str = "\n<textformat tabstops='[70, 170, 300]'>"
- function colorReyes()
- tfm.exec.setNameColor('Anto#6095', 0xFFA8D3)
- tfm.exec.setNameColor('Blood#3565', 0xCA2411)
- tfm.exec.setNameColor('Noob#5388', 0x67D8EF)
- end
- function teclas()
- for i, k in pairs(tfm.get.room.playerList) do
- tfm.exec.bindKeyboard(i, 32, false, true)
- tfm.exec.bindKeyboard(i, 46, false, true)
- tfm.exec.bindKeyboard(i, 80, false, true)
- tfm.exec.bindKeyboard(i, 76, false, true)
- tfm.exec.bindKeyboard(i, 16, false, true)
- tfm.exec.bindKeyboard(i, 77, false, true)
- tfm.exec.bindKeyboard(i, 69, false, true)
- tfm.exec.bindKeyboard(i, 8, false, true)
- -- player.info[i] = {poderes = {false, true, false}}
- -- print(player.info[i].poderes[2])
- end
- end
- teclas()
- -- print(player.info[2])
- tfm.exec.disableAfkDeath(true)
- tfm.exec.disableAutoScore(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.disableAutoNewGame(true)
- system.disableChatCommandDisplay(nil)
- colorReyes()
- --[[function activarPoderes(playerName, poder)
- if poder == "fly" then
- print(player.info[playerName].poderes[2])
- end
- end]]
- function eventChatCommand(name, command)
- args = string.split(command, ' ')
- if command == 'ayuda' or command == 'help' then
- pagina = 1
- texto =
- '<br><b><R>Comandos para mapas:</R><br></b><CE>!np</CE><V> [categoria]</V> - Cambia a un mapa de la categoria escogida. (ejemplo: !np p5)<br><CE>!np </CE><V>[code]</V> - Cambia al mapa escogido. (ejemplo: !np @7415814)<br><CE>!historial</CE> - Muestra el historial de los mapas jugados.<br><br><b><R>Comandos de habilidades:</R></b><br><CE>!fly</CE> - Activa/desactiva el poder de volar.<br><CE>!speed</CE> - Activa/desactiva el poder de volar<br><CE>!tp</CE> - Activa el poder de teletransportarse.<br><CE>!nofly</CE> o <CE>!nospeed</CE> o <CE>!notp</CE> - Desactiva el poder elegido.<br><CE>!all</CE> - Activa todos los poderes.'
- ayuda(name)
- elseif command == 'comandos' then
- verComandos(name)
- elseif command == 'historial' then
- if historial[name] then
- for i, v in ipairs(historialActivos) do
- if name == v then
- table.remove(historialActivos, i)
- end
- end
- historial[name] = false
- else
- table.insert(historialActivos, name)
- historial[name] = true
- end
- historialMaps(name)
- end
- if args[1] == 'mort' then tfm.exec.killPlayer(name) end
- if adm[name] then
- if args[1] == 'queso' or args[1] == 'cheese' or args[1] == 'q' then
- tfm.exec.giveCheese(args[2] or name)
- elseif args[1] == 'noc' or args[1] == 'noq' then
- tfm.exec.removeCheese(args[2] or name)
- elseif args[1] == 'win' then
- tfm.exec.giveCheese(args[2] or name)
- tfm.exec.playerVictory(args[2] or name)
- elseif args[1] == 'sfacil' then
- tfm.exec.setShaman(args[2] or name)
- tfm.exec.setShamanMode(args[2] or name, 0)
- elseif args[1] == 'shard' then
- tfm.exec.setShaman(args[2] or name)
- tfm.exec.setShamanMode(args[2] or name, 1)
- elseif args[1] == 'sdivine' then
- tfm.exec.setShaman(args[2] or name)
- tfm.exec.setShamanMode(args[2] or name, 2)
- elseif args[1] == 's' or args[1] == 'shaman' then
- tfm.exec.setShaman(args[2] or name)
- elseif args[1] == 'nos' or args[1] == 'noshaman' then
- tfm.exec.setShaman(args[2] or name, false)
- elseif args[1] == 'kill' then
- tfm.exec.killPlayer(args[2] or name)
- elseif args[1] == 'tp' then
- system.bindMouse(name, true)
- elseif args[1] == 'notp' then
- system.bindMouse(name, false)
- elseif args[1] == "checkpoints" then
- if checkpoints then
- checkpoints = false
- else
- checkpoints = true
- end
- elseif args[1] == "fly" then
- --activarPoderes(name, args[1])
- -- if player.info[name].poderes[2] then
- -- print("desactivado")
- --else
- -- print("activado")
- --end
- if fly[name] then
- fly[name] = false
- else
- fly[name] = true
- end
- elseif args[1] == 'nofly' then
- elseif command == 'ar' or command == 'activerespawn' or command ==
- 'activer' or command == 'arespawn' then
- if respawn then
- respawn = false
- else
- respawn = true
- end
- elseif command == 'sp' or command == 'speed' then
- tfm.exec.bindKeyboard(name, 90, false, true)
- tfm.exec.bindKeyboard(name, 88, false, true)
- if speed[name] then
- speed[name] = false
- else
- speed[name] = true
- end
- elseif command == 'all' or command == 'powers' or command == 'poderes' then
- fly[name] = true
- tfm.exec.bindKeyboard(name, 32, false, true)
- system.bindMouse(name, true)
- speed[name] = true
- tfm.exec.bindKeyboard(name, 90, false, true)
- tfm.exec.bindKeyboard(name, 88, false, true)
- elseif args[1] == 'congelar' then
- tfm.exec.freezePlayer(args[2] or name, true)
- elseif args[1] == 'descongelar' then
- tfm.exec.freezePlayer(args[2] or name, false)
- elseif command == 'copiarhistorial' then
- historialMaps(name)
- copiarHistorial = historialM:gsub('<br>', ', ')
- print('<BV> Historial de mapas:</BV>')
- print('<V>' .. copiarHistorial .. '</V>')
- elseif args[1] == 'np' then
- if args[2] == nil then
- tfm.exec.newGame('#7', false)
- else
- args[2] = args[2]:gsub('p', '#')
- tfm.exec.newGame(args[2], false)
- end
- elseif args[1] == 'respawn' or args[1] == 'r' then
- tfm.exec.respawnPlayer(args[2] or name)
- elseif args[1] == "xml" then
- -- by bolodefchoco
- local xml, current = tfm.get.room.xmlMapInfo.xml, 0
- xml = xml:gsub("<", "*"):gsub(",0,", ",,")
- print("<R>" .. tfm.get.room.currentMap .. " XML:")
- while #xml > current do
- current = current + 3001
- print("<R>" .. xml:sub(current - 3000, current):gsub("*", "<"))
- end
- end
- end
- table.insert(comandosUsados, 1, {usuario = name, comandoUsado = command})
- end
- function historialMaps(name)
- historialM = ''
- for i = 1, #historialMapas do
- historialM = '@' .. historialMapas[i] .. historialM
- end
- if historial[name] == false then
- ui.removeTextArea(100, name)
- else
- ui.addTextArea(100,
- "<p align='center'><VP>Historial Mapas<VP> <CS><br>" ..
- historialM, name, -150, 3, 100, 0, 0x2B2B2B,
- 0x121212, 0.8, true)
- end
- end
- function eventMouse(name, x, y)
- if system.bindMouse then
- tfm.exec.movePlayer(name, x, y, false, 0, 0, false)
- end
- end
- function records(nombre)
- if recordsActivos[nombre] then
- ui.removeTextArea(40, nombre)
- ui.removeTextArea(41, nombre)
- else
- ui.addTextArea(40, str, nombre, 275, 80, 250, 200, 0x2B2B2B, 0x121212,
- 1, true)
- ui.addTextArea(41,
- "<p align='center'><font size ='13' color='#00C17C'><b>Tiempos",
- nombre, 352, 65, 100, 20, 0x2B2B2B, 0x121212, 1, true)
- end
- end
- function verComandos(player)
- comandos = "<textformat tabstops='[70, 170, 300]'>"
- for i, completion in ipairs(comandosUsados) do
- comandos = comandos ..
- ('[' .. completion.usuario .. '] - !' ..
- completion.comandoUsado .. '\n')
- end
- comandos = comandos .. '</textformat>'
- ui.addTextArea(50,
- '<b><br><br>01<br>02<br>03<br>04<br>05<br>06<br>07<br>08<br>09<br>10<br>11<br>12<br>13<br>14<br>15<br>16<br>17',
- player, 155, 71, 500, 250, 0x1E1E1E, 0x121212, 1, true)
- ui.addTextArea(51,
- "<p align='center'><font size ='17' color='#00C17C'><b>Historial de Comandos",
- player, 216, 67, 400, 25, 0, 0, 1, true)
- ui.addTextArea(52,
- "<p align='center'><V><a href='event:cerrarComandos'><font size='14' color='#F93018'><b>X",
- player, 640, 69, 0, 0, 0, 0, 1, true)
- ui.addTextArea(53, comandos, player, 182, 96, 450, 213, 0x2E2E2E, 0x121212,
- 1, true)
- end
- function eventKeyboard(name, key, down, x, y)
- if key == 32 and fly[name] == true then
- tfm.exec.movePlayer(name, 0, 0, true, 0, -50, false)
- elseif key == 90 and speed[name] == true then
- tfm.exec.movePlayer(name, 0, 0, true, -100, 0, false)
- elseif key == 88 and speed[name] == true then
- tfm.exec.movePlayer(name, 0, 0, true, 100, 0, false)
- elseif key == 46 or key == 16 then
- tfm.exec.killPlayer(name)
- elseif key == 77 and adm[name] then
- tfm.exec.newGame(mapVanilla)
- mapVanilla = mapVanilla + 1
- elseif key == 80 and adm[name] then
- tfm.exec.newGame(categoria)
- table.insert(comandosUsados, 1, {
- usuario = name,
- comandoUsado = "Presionó la tecla " .. key
- })
- elseif key == 76 then
- if recordsActivos[name] then
- recordsActivos[name] = false
- else
- recordsActivos[name] = true
- end
- records(name)
- elseif key == 69 and checkpoints then
- cheese = tfm.get.room.playerList[name].hasCheese
- player.info[name].checkpoint = {true, x, y, cheese}
- ui.addTextArea(456, "", name, x, y, 5, 5, 0xFFFD93, 0x121212, 0.4,
- true)
- elseif key == 8 then
- player.info[name].checkpoint = {false, 0, 0, false}
- ui.removeTextArea(456, name)
- end
- end
- for nombre, p in pairs(tfm.get.room.playerList) do recordsActivos[nombre] = true end
- function eventPlayerWon(playerName, tiempoRonda, tiempoRespawn)
- if respawn then
- tfm.exec.respawnPlayer(playerName)
- colorReyes()
- end
- tfm.exec.setPlayerScore(playerName, 1, true)
- str = "\n<textformat tabstops='[70, 170, 300]'>"
- table.insert(times, {time = tiempoRespawn / 100, name = playerName})
- table.sort(times, function(i, v) return i.time < v.time end)
- for i, completion in ipairs(times) do
- if i <= 15 then
- if i < 10 then i = 0 .. i end
- str = str ..
- (i .. ' | ' .. completion.name .. '\t| ' ..
- completion.time .. 's\n')
- end
- end
- str = str .. '</textformat>'
- for nombre, p in pairs(tfm.get.room.playerList) do records(nombre) end
- end
- function eventNewGame()
- posicion = 0
- first = true
- times = {}
- str = "\n<textformat tabstops='[70, 170, 300]'>"
- mapActual = tfm.get.room.xmlMapInfo.mapCode .. '<br>'
- table.insert(historialMapas, mapActual)
- colorReyes()
- tiempos = {}
- tiempoJugador = {}
- for nombre, p in pairs(tfm.get.room.playerList) do
- for k, nombreHistorial in pairs(historialActivos) do
- if nombre == nombreHistorial then historialMaps(nombre) end
- end
- -- player.info[nombre] = {poderes = {false, true, false}}
- player.info[nombre] = {checkpoint = {false, 0, 0, false}}
- ui.removeTextArea(456, nombre)
- end
- end
- function ayuda(name)
- ui.addTextArea(0, texto, name, 200, 80, 400, 200, 0x2B2B2B, 0x121212, 1,
- true)
- ui.addTextArea(1,
- "<p align='center'><font size ='13' color='#00C17C'><b>Ayuda",
- name, 350, 65, 100, 20, 0x2B2B2B, 0x121212, 1, true)
- ui.addTextArea(2,
- "<p align='center'><V><a href='event:cerrar'><font size='14' color='#F93018'><b>X",
- name, 583, 78, 0, 0, 0, 0, 1, true)
- ui.addTextArea(3,
- "<p align='center'><V><a href='event:paginaSiguiente'><font size='14'><b>»",
- name, 560, 288, 40, 20, 0x2B2B2B, 0x121212, 1, true)
- ui.addTextArea(4,
- "<p align='center'><V><a href='event:paginaAnterior'><font size='14'><b>«",
- name, 514, 288, 40, 20, 0x2B2B2B, 0x121212, 1, true)
- ui.addTextArea(5,
- "<p align='center'><font size ='13' color='#00C17C'><b>" ..
- pagina .. '/3', name, 200, 288, 50, 20, 0x2B2B2B,
- 0x121212, 1, true)
- end
- function eventTextAreaCallback(id, name, callBack)
- if callBack == 'cerrar' then
- for i = 0, 17, 1 do ui.removeTextArea(i, name) end
- elseif callBack == 'paginaSiguiente' then
- if pagina <= 2 then pagina = pagina + 1 end
- if pagina == 2 then
- texto =
- '<br><b><R>Comandos de chamán:</R></b><br><CE>!s</CE><V> [nombreJugador]</V> - El jugador será chamán con su modo actual.<br><CE>!sfacil</CE><V> [nombreJugador]</V> - El jugador será chamán en modo fácil.<br><CE>!shard</CE><V> [nombreJugador] </V>- El jugador será chamán en modo díficil.<br><CE>!sdivine</CE><V> [nombreJugador]</V> - El jugador será chamán en modo divino.<br><br><b><R>Comandos útiles:</R><br></b><CE>!ayuda</CE> - Abre esta ventana.<br><CE>!queso</CE><V> [nombreJugador]</V> - Da queso al jugador.<br><CE>!noqueso </CE><V>[nombreJugador]</V> - Remueve el queso del jugador.<br><CE>!win</CE><V> [nombreJugador]</V> - El jugador ganará el mapa.<br><CE>!respawn</CE> <V>[nombreJugador]</V> - Respawnea al jugador.<br><CE>!arespawn</CE> - Activa/desactiva el autorespawn.'
- elseif pagina == 1 then
- texto =
- '<br><b><R>Comandos para mapas:</R><br></b><CE>!np</CE><V> [categoria]</V> - Cambia a un mapa de la categoria escogida. (ejemplo: !np p5)<br><CE>!np </CE><V>[code]</V> - Cambia al mapa escogido. (ejemplo: !np @7415814)<br><CE>!historial</CE> - Muestra el historial de los mapas jugados.<br><br><b><R>Comandos de habilidades:</R></b><br><CE>!fly</CE> - Activa/desactiva el poder de volar.<br><CE>!speed</CE> - Activa/desactiva el poder de volar<br><CE>!tp</CE> - Activa el poder de teletransportarse.<br><CE>!nofly</CE> o <CE>!nospeed</CE> o <CE>!notp</CE> - Desactiva el poder elegido.<br><CE>!all</CE> - Activa todos los poderes.'
- elseif pagina == 3 then
- texto =
- "<br><b><R>Otros comandos:</R><br></b><CE>!copiarhistorial</CE> - La lista de todos los mapas jugados apareceran en el chat #lua. [sólo valido para la persona que este ejecutando el lua]<br><br><b><R><font size = '13'>Nota</font></R></b><br>La mayoría de los comandos tienen su propia abreviatura, como por ejemplo escribir <CE>!r</CE><V> [nombreJugador]</V> es lo mismos que escribir <CE>!respawn</CE><V> [nombreJugador]</V>, o también <CE>!nof </CE>equivale a <CE>!nofly</CE>, etc."
- end
- ayuda(name)
- elseif callBack == 'paginaAnterior' then
- if pagina >= 2 then pagina = pagina - 1 end
- if pagina == 2 then
- texto =
- '<br><b><R>Comandos de chamán:</R></b><br><CE>!s</CE><V> [nombreJugador]</V> - El jugador será chamán con su modo actual.<br><CE>!sfacil</CE><V> [nombreJugador]</V> - El jugador será chamán en modo fácil.<br><CE>!shard</CE><V> [nombreJugador] </V>- El jugador será chamán en modo díficil.<br><CE>!sdivine</CE><V> [nombreJugador]</V> - El jugador será chamán en modo divino.<br><br><b><R>Comandos útiles:</R><br></b><CE>!ayuda</CE> - Abre esta ventana.<br><CE>!queso</CE><V> [nombreJugador]</V> - Da queso al jugador.<br><CE>!noqueso </CE><V>[nombreJugador]</V> - Remueve el queso del jugador.<br><CE>!win</CE><V> [nombreJugador]</V> - El jugador ganará el mapa.<br><CE>!respawn</CE> <V>[nombreJugador]</V> - Respawnea al jugador.<br><CE>!arespawn</CE> - Activa/desactiva el autorespawn.'
- elseif pagina == 1 then
- texto =
- '<br><b><R>Comandos para mapas:</R><br></b><CE>!np</CE><V> [categoria]</V> - Cambia a un mapa de la categoria escogida. (ejemplo: !np p5)<br><CE>!np </CE><V>[code]</V> - Cambia al mapa escogido. (ejemplo: !np @7415814)<br><CE>!historial</CE> - Muestra el historial de los mapas jugados.<br><br><b><R>Comandos de habilidades:</R></b><br><CE>!fly</CE> - Activa/desactiva el poder de volar.<br><CE>!speed</CE> - Activa/desactiva el poder de volar<br><CE>!tp</CE> - Activa el poder de teletransportarse.<br><CE>!nofly</CE> o <CE>!nospeed</CE> o <CE>!notp</CE> - Desactiva el poder elegido.<br><CE>!all</CE> - Activa todos los poderes.'
- end
- ayuda(name)
- elseif callBack == 'cerrarComandos' then
- for i = 50, 53 do ui.removeTextArea(i, name) end
- end
- end
- function eventNewPlayer(jugador)
- teclas()
- recordsActivos[jugador] = true
- tfm.exec.respawnPlayer(jugador)
- ui.addTextArea(15,
- "<p align='center'><V><a href='event:settings'><font color='#C2C2DA'><b>?",
- jugador, 3, -22, 20, 0, 0x3C5064, 0x2D3C4B, 1, true)
- player.info[jugador] = {checkpoint = {false, 0, 0, false}}
- -- player.info[nombre] = {checkpoint = {false, 0, 0, false}}
- end
- function eventPlayerDied(playerName)
- if respawn then
- tfm.exec.respawnPlayer(playerName)
- if player.info[playerName].checkpoint[1] and checkpoints then
- tfm.exec.movePlayer(playerName,
- player.info[playerName].checkpoint[2],
- player.info[playerName].checkpoint[3])
- if player.info[playerName].checkpoint[4] then
- tfm.exec.giveCheese(playerName)
- end
- end
- colorReyes()
- end
- end
- function eventPlayerLeft (playerName)
- print(player.info[playerName].checkpoint[1])
- end
- ui.addTextArea(15,
- "<p align='center'><V><a href='event:settings'><font color='#C2C2DA'><b>?",
- nil, 5, -22, 20, 0, 0x3C5064, 0x2D3C4B, 1, true)
- function string.split(s, pattern, n)
- local st = {}
- for sb in string.gmatch(s, '[^' .. pattern .. ']+') do
- if not n or n > -1 then
- table.insert(st, sb)
- else
- st[#st] = st[#st] .. pattern .. sb
- end
- n = n and n - 1 or false
- end
- return st
- end
- tfm.exec.newGame('#7', false)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement