daily pastebin goal
66%
SHARE
TWEET

Untitled

HackinMauro Jan 11th, 2019 (edited) 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local admins = {"Soyloquisha#0000"}
  2. local banlist = {}
  3. local objects = {17}
  4. local maps = {7524569,7524554}
  5.  
  6. function main()
  7. tfm.exec.disableAutoNewGame (true)
  8. tfm.exec.disableAutoTimeLeft (true)
  9. startNewGame();
  10. end
  11.  
  12. function startNewGame()
  13. countDown  = 5
  14. tfm.exec.disableAutoShaman(true)
  15. tfm.exec.newGame (maps[math.random(#maps)]);
  16. tfm.exec.setUIMapName("#Perfect<bl>Match")
  17. tfm.exec.setGameTime (200);
  18. end
  19.  
  20. function eventPlayerDied (playerName)
  21. local playersAlive = 0;
  22. local winner;
  23.  
  24. for player in pairs(tfm.get.room.playerList) do
  25. if not tfm.get.room.playerList[player].isDead then
  26. playersAlive = playersAlive + 1;
  27. winner = player;
  28. end
  29. end
  30.  
  31. if (playersAlive ==0) then
  32. startNewGame();
  33. end
  34. end
  35.  
  36. main();
  37.  
  38. function isBanned (playerName)
  39. for _,bannedName in pairs(banlist) do
  40. if playerName == bannedName then return true end
  41. end
  42. return false
  43. end
  44.  
  45. function isAdmin (playerName)
  46. for _,adminName in pairs(admins) do
  47. if playerName == adminName then return true end
  48. end
  49. return false
  50. end
  51.  
  52. function eventChatCommand (playerName, command)
  53. if isBanned(playerName) then return end
  54.  
  55. args = {}
  56. for arg in command:gmatch ("[^%s]+") do
  57. table.insert (args, arg)
  58. end
  59.  
  60. if args[1] == "ban" and tfm.get.room.playerList[args[2]] then
  61. if isAdmin (playerName) then
  62. if isBanned(args[2]) then
  63. ui.addPopup (0, 0, "Error: "..args[2].." ya está banead@.", playerName, 350, 200, 100)
  64. elseif isAdmin(args[2]) then
  65. ui.addPopup (0, 0, "Error: "..args[2].." es un admin.", playerName, 350, 200, 100)
  66. else
  67. table.insert (banlist, args[2])
  68. tfm.exec.killPlayer(args[2]);
  69. ui.addPopup (0, 0, "¡Has sido banead@! ", args[2], 350, 200, 100)
  70. ui.addPopup (1, 0, "¡"..args[2].." ha sido banead@!", playerName, 350, 200, 100)
  71. end
  72. else
  73. ui.addPopup (0, 0, "Error", playerName, 350, 200, 100)
  74. end
  75. elseif args[1] == "desban" and tfm.get.room.playerList[args[2]] then
  76. if isAdmin (playerName) then
  77. if not isBanned(args[2]) then
  78. ui.addPopup (0, 0, "Error: "..args[2].." no está baneado.", playerName, 350, 200, 100)
  79. else
  80. for i,bannedName in pairs(banlist) do
  81. if args[2] == bannedName then
  82. table.remove (banlist, i)
  83. break
  84. end
  85. end
  86. ui.addPopup (0, 0, "¡Has sido desbaneado!", args[2], 350, 200, 100)
  87. ui.addPopup (1, 0, "¡"..args[2].." ha sido desbaneado!", playerName, 350, 200, 100)
  88. end
  89. else
  90. ui.addPopup (0, 0, "Solo los administradores pueden usar este comando", playerName, 350, 200, 100)
  91. end
  92.  
  93.  
  94. elseif command == "help" then
  95. ui.addPopup (0,0,"#PerfectMatch fue creado por Soyloquisha#0000.   ________________________________________________________‏                                                                                                              ¡Bienvenido a #PerfectMatch! ‎‎ ‎ ‎ ‏‏‎‎‎ ‎ ‎                                                            En este juegos lo ratoncitos deberán esquivar los objetos que caerán del cielo con su pareja.                                                                         La pareja que gane será elegida como el ¡Perfect Match!‏                                                                    ________________________________________________________‏                                                                               »Comandos del teclado                                                                                   «Barra espaciadora»Hace que tu ratón haga un super salto.                                                                                         ________________________________________________________‏                                                                                                       Créditos                                                                                                                                                 Estás personas han ayudado de alguna manera, con un código, una traducción,etc                                                                                   ❤Gracias❤", playerName, 200, 100, 400)
  96.  
  97. elseif command=="mensaje" then
  98. ui.addPopup(999,2,"<p align='center'>Escribe tu mensaje en el siguiente cuadro</p>",playerName,300,200,200);
  99. end
  100. end
  101. function eventNewGame (PlayerName)
  102. for _,playerName in pairs(banlist) do
  103. tfm.exec.killPlayer(playerName);
  104. end
  105. end
  106.  
  107. function eventNewPlayer (playerName)
  108. if isBanned(playerName) then
  109. tfm.exec.killPlayer(playerName);
  110. end
  111. end
  112.  
  113. function eventPlayerRespawn (playerName)
  114. if isBanned(playerName) then
  115. tfm.exec.killPlayer(playerName);
  116. end
  117. end
  118.  
  119.  
  120. function eventPopupAnswer(Id,Name,answer)
  121. if Id==999 then
  122. ui.addPopup(0,0,"<font color='#ED67EA'><b>•[Moderación]</b></font> "..answer.."",p,300,200,200)
  123. end
  124. end
  125.  
  126.  
  127. function eventLoop (a,b)
  128.  if countDown == 0 then
  129. for i=1,math.random(1,3) do
  130. tfm.exec.addShamanObject (objects[math.random(#objects)],
  131. math.random(900), math.random(-400,-100));
  132.  end
  133. end
  134.  
  135. if countDown  >= 1 then
  136. countDown  = countDown  - 1
  137. elseif countDown  == 0 then
  138. end
  139.  
  140.  if b <= 0 then
  141.  startNewGame();
  142. end
  143.  
  144. end
  145.  
  146.  
  147. function eventPlayerDied(n)
  148.     local players = {}
  149.     for pl, data in next, tfm.get.room.playerList do
  150.         if not data.isDead then
  151.             players[#players+1] = pl
  152.         end
  153.     end
  154.     if #players<=2 then
  155.         for _, pl in next, players do
  156.             tfm.exec.giveCheese(pl)
  157.             tfm.exec.playerVictory(pl)
  158. tfm.exec.setGameTime(5)
  159.         end
  160.     end
  161.  
  162. end
  163.  
  164. local power = 100
  165. local players = {}
  166.  
  167. function eventNewPlayer(name)
  168.     if (not players[name]) then players[name] = { canJump = true } end
  169.     system.bindKeyboard(name, 1, true);system.bindKeyboard(name, 32, true)
  170. end
  171. table.foreach(tfm.get.room.playerList, eventNewPlayer)
  172.  
  173. function eventNewGame()
  174.     for k, v in next, players do v.canJump = true end
  175. end
  176.  
  177. function eventKeyboard(name, key)
  178.     if (key == 1) then
  179.         tfm.get.room.playerList[name].isJumping = true
  180.     elseif (key == 32) then
  181.         if (players[name].canJump and tfm.get.room.playerList[name].isJumping) then
  182.             players[name].canJump = false;tfm.exec.movePlayer(name, 0, 0, false, 0, (- power))
  183.         end
  184. end
  185. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top