Advertisement
alditojeje

Untitled

Aug 18th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.29 KB | None | 0 0
  1. -- cuando ponen !copiarhistorial que no se abra el historial, explosion personalizada, tamaño funcorp
  2. local adm = {
  3. ['Blood#3565'] = true,
  4. ['Anto#6095'] = true,
  5. ['His#0439'] = true,
  6. ['Alditohacker#0000'] = true,
  7. ['Beckham#0977'] = true,
  8. ['Kiwi#8872'] = true,
  9. ['Noob#5388'] = true,
  10. ['Misterthepro#0000'] = true,
  11. ['Edudekarly#3398'] = true,
  12. ['Ansatsu#0368'] = true}
  13.  
  14. local fly = {}
  15. local speed = {}
  16. respawn = true
  17. args = {}
  18. historialMapas = {}
  19. historial = {}
  20. historialActivos = {}
  21. recordsActivos = {}
  22. times = {}
  23. comandosUsados = {}
  24. categoria = '#13'
  25. mapVanilla = 0
  26. player = {info = {checkpoint = {}}, poderes = {}}
  27. checkpoints = false
  28. str = "\n<textformat tabstops='[70, 170, 300]'>"
  29.  
  30. function colorReyes()
  31. tfm.exec.setNameColor('Anto#6095', 0xFFA8D3)
  32. tfm.exec.setNameColor('Blood#3565', 0xCA2411)
  33. tfm.exec.setNameColor('Noob#5388', 0x67D8EF)
  34. end
  35.  
  36. function teclas()
  37. for i, k in pairs(tfm.get.room.playerList) do
  38. tfm.exec.bindKeyboard(i, 32, false, true)
  39. tfm.exec.bindKeyboard(i, 46, false, true)
  40. tfm.exec.bindKeyboard(i, 80, false, true)
  41. tfm.exec.bindKeyboard(i, 76, false, true)
  42. tfm.exec.bindKeyboard(i, 16, false, true)
  43. tfm.exec.bindKeyboard(i, 77, false, true)
  44. tfm.exec.bindKeyboard(i, 69, false, true)
  45. tfm.exec.bindKeyboard(i, 8, false, true)
  46. -- player.info[i] = {poderes = {false, true, false}}
  47. -- print(player.info[i].poderes[2])
  48. end
  49. end
  50.  
  51. teclas()
  52. -- print(player.info[2])
  53.  
  54. tfm.exec.disableAfkDeath(true)
  55. tfm.exec.disableAutoScore(true)
  56. tfm.exec.disableAutoShaman(true)
  57. tfm.exec.disableAutoTimeLeft(true)
  58. tfm.exec.disableAutoNewGame(true)
  59. system.disableChatCommandDisplay(nil)
  60. colorReyes()
  61.  
  62.  
  63. --[[function activarPoderes(playerName, poder)
  64. if poder == "fly" then
  65. print(player.info[playerName].poderes[2])
  66. end
  67. end]]
  68.  
  69. function eventChatCommand(name, command)
  70. args = string.split(command, ' ')
  71. if command == 'ayuda' or command == 'help' then
  72. pagina = 1
  73. texto =
  74. '<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.'
  75. ayuda(name)
  76. elseif command == 'comandos' then
  77. verComandos(name)
  78. elseif command == 'historial' then
  79. if historial[name] then
  80. for i, v in ipairs(historialActivos) do
  81. if name == v then
  82. table.remove(historialActivos, i)
  83. end
  84. end
  85. historial[name] = false
  86. else
  87. table.insert(historialActivos, name)
  88. historial[name] = true
  89. end
  90. historialMaps(name)
  91. end
  92. if args[1] == 'mort' then tfm.exec.killPlayer(name) end
  93. if adm[name] then
  94. if args[1] == 'queso' or args[1] == 'cheese' or args[1] == 'q' then
  95. tfm.exec.giveCheese(args[2] or name)
  96. elseif args[1] == 'noc' or args[1] == 'noq' then
  97. tfm.exec.removeCheese(args[2] or name)
  98. elseif args[1] == 'win' then
  99. tfm.exec.giveCheese(args[2] or name)
  100. tfm.exec.playerVictory(args[2] or name)
  101. elseif args[1] == 'sfacil' then
  102. tfm.exec.setShaman(args[2] or name)
  103. tfm.exec.setShamanMode(args[2] or name, 0)
  104. elseif args[1] == 'shard' then
  105. tfm.exec.setShaman(args[2] or name)
  106. tfm.exec.setShamanMode(args[2] or name, 1)
  107. elseif args[1] == 'sdivine' then
  108. tfm.exec.setShaman(args[2] or name)
  109. tfm.exec.setShamanMode(args[2] or name, 2)
  110. elseif args[1] == 's' or args[1] == 'shaman' then
  111. tfm.exec.setShaman(args[2] or name)
  112. elseif args[1] == 'nos' or args[1] == 'noshaman' then
  113. tfm.exec.setShaman(args[2] or name, false)
  114. elseif args[1] == 'kill' then
  115. tfm.exec.killPlayer(args[2] or name)
  116. elseif args[1] == 'tp' then
  117. system.bindMouse(name, true)
  118. elseif args[1] == 'notp' then
  119. system.bindMouse(name, false)
  120. elseif args[1] == "checkpoints" then
  121. if checkpoints then
  122. checkpoints = false
  123. else
  124. checkpoints = true
  125. end
  126. elseif args[1] == "fly" then
  127. --activarPoderes(name, args[1])
  128. -- if player.info[name].poderes[2] then
  129.  
  130. -- print("desactivado")
  131. --else
  132. -- print("activado")
  133. --end
  134. if fly[name] then
  135. fly[name] = false
  136. else
  137. fly[name] = true
  138. end
  139. elseif args[1] == 'nofly' then
  140. elseif command == 'ar' or command == 'activerespawn' or command ==
  141. 'activer' or command == 'arespawn' then
  142. if respawn then
  143. respawn = false
  144. else
  145. respawn = true
  146. end
  147. elseif command == 'sp' or command == 'speed' then
  148. tfm.exec.bindKeyboard(name, 90, false, true)
  149. tfm.exec.bindKeyboard(name, 88, false, true)
  150. if speed[name] then
  151. speed[name] = false
  152. else
  153. speed[name] = true
  154. end
  155. elseif command == 'all' or command == 'powers' or command == 'poderes' then
  156. fly[name] = true
  157. tfm.exec.bindKeyboard(name, 32, false, true)
  158. system.bindMouse(name, true)
  159. speed[name] = true
  160. tfm.exec.bindKeyboard(name, 90, false, true)
  161. tfm.exec.bindKeyboard(name, 88, false, true)
  162. elseif args[1] == 'congelar' then
  163. tfm.exec.freezePlayer(args[2] or name, true)
  164. elseif args[1] == 'descongelar' then
  165. tfm.exec.freezePlayer(args[2] or name, false)
  166. elseif command == 'copiarhistorial' then
  167. historialMaps(name)
  168. copiarHistorial = historialM:gsub('<br>', ', ')
  169. print('<BV> Historial de mapas:</BV>')
  170. print('<V>' .. copiarHistorial .. '</V>')
  171. elseif args[1] == 'np' then
  172. if args[2] == nil then
  173. tfm.exec.newGame('#7', false)
  174. else
  175. args[2] = args[2]:gsub('p', '#')
  176. tfm.exec.newGame(args[2], false)
  177. end
  178. elseif args[1] == 'respawn' or args[1] == 'r' then
  179. tfm.exec.respawnPlayer(args[2] or name)
  180. elseif args[1] == "xml" then
  181. -- by bolodefchoco
  182. local xml, current = tfm.get.room.xmlMapInfo.xml, 0
  183. xml = xml:gsub("<", "*"):gsub(",0,", ",,")
  184. print("<R>" .. tfm.get.room.currentMap .. " XML:")
  185. while #xml > current do
  186. current = current + 3001
  187. print("<R>" .. xml:sub(current - 3000, current):gsub("*", "&lt;"))
  188. end
  189. end
  190. end
  191. table.insert(comandosUsados, 1, {usuario = name, comandoUsado = command})
  192. end
  193.  
  194. function historialMaps(name)
  195. historialM = ''
  196. for i = 1, #historialMapas do
  197. historialM = '@' .. historialMapas[i] .. historialM
  198. end
  199. if historial[name] == false then
  200. ui.removeTextArea(100, name)
  201. else
  202. ui.addTextArea(100,
  203. "<p align='center'><VP>Historial Mapas<VP> <CS><br>" ..
  204. historialM, name, -150, 3, 100, 0, 0x2B2B2B,
  205. 0x121212, 0.8, true)
  206. end
  207. end
  208.  
  209. function eventMouse(name, x, y)
  210. if system.bindMouse then
  211. tfm.exec.movePlayer(name, x, y, false, 0, 0, false)
  212. end
  213. end
  214.  
  215. function records(nombre)
  216. if recordsActivos[nombre] then
  217. ui.removeTextArea(40, nombre)
  218. ui.removeTextArea(41, nombre)
  219. else
  220. ui.addTextArea(40, str, nombre, 275, 80, 250, 200, 0x2B2B2B, 0x121212,
  221. 1, true)
  222. ui.addTextArea(41,
  223. "<p align='center'><font size ='13' color='#00C17C'><b>Tiempos",
  224. nombre, 352, 65, 100, 20, 0x2B2B2B, 0x121212, 1, true)
  225. end
  226. end
  227.  
  228. function verComandos(player)
  229. comandos = "<textformat tabstops='[70, 170, 300]'>"
  230. for i, completion in ipairs(comandosUsados) do
  231. comandos = comandos ..
  232. ('[' .. completion.usuario .. '] - !' ..
  233. completion.comandoUsado .. '\n')
  234. end
  235. comandos = comandos .. '</textformat>'
  236. ui.addTextArea(50,
  237. '<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',
  238. player, 155, 71, 500, 250, 0x1E1E1E, 0x121212, 1, true)
  239. ui.addTextArea(51,
  240. "<p align='center'><font size ='17' color='#00C17C'><b>Historial de Comandos",
  241. player, 216, 67, 400, 25, 0, 0, 1, true)
  242. ui.addTextArea(52,
  243. "<p align='center'><V><a href='event:cerrarComandos'><font size='14' color='#F93018'><b>X",
  244. player, 640, 69, 0, 0, 0, 0, 1, true)
  245. ui.addTextArea(53, comandos, player, 182, 96, 450, 213, 0x2E2E2E, 0x121212,
  246. 1, true)
  247. end
  248.  
  249. function eventKeyboard(name, key, down, x, y)
  250. if key == 32 and fly[name] == true then
  251. tfm.exec.movePlayer(name, 0, 0, true, 0, -50, false)
  252. elseif key == 90 and speed[name] == true then
  253. tfm.exec.movePlayer(name, 0, 0, true, -100, 0, false)
  254. elseif key == 88 and speed[name] == true then
  255. tfm.exec.movePlayer(name, 0, 0, true, 100, 0, false)
  256. elseif key == 46 or key == 16 then
  257. tfm.exec.killPlayer(name)
  258. elseif key == 77 and adm[name] then
  259. tfm.exec.newGame(mapVanilla)
  260. mapVanilla = mapVanilla + 1
  261. elseif key == 80 and adm[name] then
  262. tfm.exec.newGame(categoria)
  263. table.insert(comandosUsados, 1, {
  264. usuario = name,
  265. comandoUsado = "Presionó la tecla " .. key
  266. })
  267.  
  268. elseif key == 76 then
  269. if recordsActivos[name] then
  270. recordsActivos[name] = false
  271. else
  272. recordsActivos[name] = true
  273. end
  274. records(name)
  275. elseif key == 69 and checkpoints then
  276. cheese = tfm.get.room.playerList[name].hasCheese
  277. player.info[name].checkpoint = {true, x, y, cheese}
  278. ui.addTextArea(456, "", name, x, y, 5, 5, 0xFFFD93, 0x121212, 0.4,
  279. true)
  280. elseif key == 8 then
  281. player.info[name].checkpoint = {false, 0, 0, false}
  282. ui.removeTextArea(456, name)
  283. end
  284. end
  285.  
  286. for nombre, p in pairs(tfm.get.room.playerList) do recordsActivos[nombre] = true end
  287.  
  288. function eventPlayerWon(playerName, tiempoRonda, tiempoRespawn)
  289. if respawn then
  290. tfm.exec.respawnPlayer(playerName)
  291. colorReyes()
  292. end
  293. tfm.exec.setPlayerScore(playerName, 1, true)
  294. str = "\n<textformat tabstops='[70, 170, 300]'>"
  295. table.insert(times, {time = tiempoRespawn / 100, name = playerName})
  296. table.sort(times, function(i, v) return i.time < v.time end)
  297. for i, completion in ipairs(times) do
  298. if i <= 15 then
  299. if i < 10 then i = 0 .. i end
  300. str = str ..
  301. (i .. ' | ' .. completion.name .. '\t| ' ..
  302. completion.time .. 's\n')
  303. end
  304. end
  305. str = str .. '</textformat>'
  306. for nombre, p in pairs(tfm.get.room.playerList) do records(nombre) end
  307. end
  308.  
  309. function eventNewGame()
  310. posicion = 0
  311. first = true
  312. times = {}
  313. str = "\n<textformat tabstops='[70, 170, 300]'>"
  314. mapActual = tfm.get.room.xmlMapInfo.mapCode .. '<br>'
  315. table.insert(historialMapas, mapActual)
  316. colorReyes()
  317. tiempos = {}
  318. tiempoJugador = {}
  319. for nombre, p in pairs(tfm.get.room.playerList) do
  320. for k, nombreHistorial in pairs(historialActivos) do
  321. if nombre == nombreHistorial then historialMaps(nombre) end
  322. end
  323. -- player.info[nombre] = {poderes = {false, true, false}}
  324. player.info[nombre] = {checkpoint = {false, 0, 0, false}}
  325. ui.removeTextArea(456, nombre)
  326. end
  327. end
  328.  
  329. function ayuda(name)
  330. ui.addTextArea(0, texto, name, 200, 80, 400, 200, 0x2B2B2B, 0x121212, 1,
  331. true)
  332. ui.addTextArea(1,
  333. "<p align='center'><font size ='13' color='#00C17C'><b>Ayuda",
  334. name, 350, 65, 100, 20, 0x2B2B2B, 0x121212, 1, true)
  335. ui.addTextArea(2,
  336. "<p align='center'><V><a href='event:cerrar'><font size='14' color='#F93018'><b>X",
  337. name, 583, 78, 0, 0, 0, 0, 1, true)
  338. ui.addTextArea(3,
  339. "<p align='center'><V><a href='event:paginaSiguiente'><font size='14'><b>»",
  340. name, 560, 288, 40, 20, 0x2B2B2B, 0x121212, 1, true)
  341. ui.addTextArea(4,
  342. "<p align='center'><V><a href='event:paginaAnterior'><font size='14'><b>«",
  343. name, 514, 288, 40, 20, 0x2B2B2B, 0x121212, 1, true)
  344. ui.addTextArea(5,
  345. "<p align='center'><font size ='13' color='#00C17C'><b>" ..
  346. pagina .. '/3', name, 200, 288, 50, 20, 0x2B2B2B,
  347. 0x121212, 1, true)
  348. end
  349.  
  350. function eventTextAreaCallback(id, name, callBack)
  351. if callBack == 'cerrar' then
  352. for i = 0, 17, 1 do ui.removeTextArea(i, name) end
  353. elseif callBack == 'paginaSiguiente' then
  354. if pagina <= 2 then pagina = pagina + 1 end
  355. if pagina == 2 then
  356. texto =
  357. '<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.'
  358. elseif pagina == 1 then
  359. texto =
  360. '<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.'
  361. elseif pagina == 3 then
  362. texto =
  363. "<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."
  364. end
  365. ayuda(name)
  366. elseif callBack == 'paginaAnterior' then
  367. if pagina >= 2 then pagina = pagina - 1 end
  368. if pagina == 2 then
  369. texto =
  370. '<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.'
  371. elseif pagina == 1 then
  372. texto =
  373. '<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.'
  374. end
  375. ayuda(name)
  376. elseif callBack == 'cerrarComandos' then
  377. for i = 50, 53 do ui.removeTextArea(i, name) end
  378. end
  379. end
  380.  
  381. function eventNewPlayer(jugador)
  382. teclas()
  383. recordsActivos[jugador] = true
  384. tfm.exec.respawnPlayer(jugador)
  385. ui.addTextArea(15,
  386. "<p align='center'><V><a href='event:settings'><font color='#C2C2DA'><b>?",
  387. jugador, 3, -22, 20, 0, 0x3C5064, 0x2D3C4B, 1, true)
  388. player.info[jugador] = {checkpoint = {false, 0, 0, false}}
  389. -- player.info[nombre] = {checkpoint = {false, 0, 0, false}}
  390. end
  391.  
  392. function eventPlayerDied(playerName)
  393. if respawn then
  394. tfm.exec.respawnPlayer(playerName)
  395. if player.info[playerName].checkpoint[1] and checkpoints then
  396. tfm.exec.movePlayer(playerName,
  397. player.info[playerName].checkpoint[2],
  398. player.info[playerName].checkpoint[3])
  399. if player.info[playerName].checkpoint[4] then
  400. tfm.exec.giveCheese(playerName)
  401. end
  402. end
  403. colorReyes()
  404. end
  405. end
  406.  
  407. function eventPlayerLeft (playerName)
  408. print(player.info[playerName].checkpoint[1])
  409. end
  410.  
  411. ui.addTextArea(15,
  412. "<p align='center'><V><a href='event:settings'><font color='#C2C2DA'><b>?",
  413. nil, 5, -22, 20, 0, 0x3C5064, 0x2D3C4B, 1, true)
  414.  
  415. function string.split(s, pattern, n)
  416. local st = {}
  417. for sb in string.gmatch(s, '[^' .. pattern .. ']+') do
  418. if not n or n > -1 then
  419. table.insert(st, sb)
  420. else
  421. st[#st] = st[#st] .. pattern .. sb
  422. end
  423. n = n and n - 1 or false
  424. end
  425. return st
  426. end
  427.  
  428. tfm.exec.newGame('#7', false)
  429.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement