Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.23 KB | None | 0 0
  1. tfm.exec.disableAutoNewGame(true)
  2. tfm.exec.disableAutoShaman(true)
  3. tfm.exec.disableAutoTimeLeft ( activate )
  4. players={}
  5. toDespawn={}
  6. local infinito = 10
  7. maps={7675023,521833,401421,541917,541928,541936,541943,527935,559634,559644,888052,878047,885641,770600,770656,772172,891472,589736,589800,589708,900012,901062,754380,901337,901411,907870,910078,1190467,1252043,1124380,1016258,1252299,1255902,1256808,986790,1285380,1271249,1255944,1255983,1085344,1273114,1276664,1279258,1286824,1280135,1280342,1284861,1287556,1057753,1196679,1288489,1292983,1298164,1298521,1293189,1296949,1308378,1311136,1314419,1314982,1318248,1312411,1312589,1312845,1312933,1313969,1338762,1339474,1349878,1297154,644588,1351237,1354040,1354375,1362386,1283234,1370578,1306592,1360889,1362753,1408124,1407949,1407849,1343986,1408028,1441370,1443416,1389255,1427349,1450527,1424739,869836,1459902,1392993,1426457,1542824,1533474,1561467,1563534,1566991,1587241,1416119,1596270,1601580,1525751,1582146,1558167,1420943,1466487,1642575,1648013,1646094,1393097,1643446,1545219,1583484,1613092,1627981,1633374,1633277,1633251,1585138,1624034,1616785,1625916,1667582,1666996,1675013,1675316,1531316,1665413,1681719,1699880,1688696,623770,1727243,1531329,1683915,1689533,1738601,3756146,912118,3326933,3722005,3566478,1456622,1357994,1985670,1884075,1708065,1700322,2124484,3699046,2965313,4057963,4019126,3335202,2050466}
  8.  
  9. function eventNewPlayer(name)
  10. ui . addTextArea ( 991 , "<p align = 'center'> <font size = '15px' color = '# FFD800'>Deatmatch" , nil , 310 , 375 , 175 , 25 , 0x000000 , 0xFFFFFF , 0.5 , true )
  11. ui.addPopup (1,0,"Bienvenido a <b>Friendly Town</b>. <br><p align='center'><font size='20'><b><font face='Soopafresh'>Ayuda:</font></b><br></font><font size='15'></br> <br><font color='#2019d5'>Este pequeño minijuego esta basado en deatmatch pero modificado , disfrutalo.</br> <br><font><font color='#BABD2F'>Moderadores del juego: Tiburoncin23#9884 y Jitotranss#0000\n</font> <font color='#19d55c'>Codigo lua por Tiburoncin23#9884</br>", name, 250, 130, 270);
  12.  
  13.  
  14. for i,key in ipairs({32,40,83,69}) do
  15. tfm.exec.bindKeyboard(name,key,true,true)
  16. end
  17. players[name]={
  18. timestamp=os.time(),
  19. offsets={x=2, y=10},
  20. score=0
  21. }
  22.  
  23. end
  24.  
  25. function eventKeyboard(name,key,down,x,y)
  26. if (key==32 or key==40 or key==83) and not tfm.get.room.playerList[name].isDead and started then
  27. if players[name].timestamp < os.time()-1000 then
  28. local id=tfm.exec.addShamanObject(17, x-(tfm.get.room.playerList[name].isFacingRight and players[name].offsets.x or -players[name].offsets.x), y+players[name].offsets.y, tfm.get.room.playerList[name].isFacingRight and 90 or 270)
  29. players[name].timestamp=os.time()
  30. table.insert(toDespawn,{os.time(),id})
  31. end
  32. end
  33. if key==69 then
  34. if name == "Tiburoncin23#9884" or name == "Jitotranss#0000" then
  35. tfm.exec.movePlayer(name,0,0,true,0,-50,true)
  36. end
  37. end
  38. end
  39.  
  40.  
  41. function eventPlayerWon(n)
  42. players[n].score = players[n].score + 1
  43. ui.addTextArea(2, "<font size='15' face='impact'><p align='center'><G>"..n, nil, 300, 60, 190, 21, 0x324650, 0x000000, 0, true)
  44.  
  45.  
  46. ui.addTextArea(12, "<p align='center'><font size='50' face='impact'><J>RONDAS</J> <S>GANADAS: <vi> "..players[n].score, nil, 150, 10, 501, 83, 0x324650, 0x000000, 0, true)
  47. ui.addTextArea(993,"<VI>"..n.." <N>¡Ganó el enfrentamiento!",nil,555,330,nil,nil,0x000000 ,0xFFFFFF,0.5,true)
  48. end
  49. function eventNewGame()
  50. started=false
  51. end
  52.  
  53.  
  54.  
  55.  
  56. function eventChatCommand(player, command)
  57. local args = {}
  58. for arg in command:gmatch("[^%s]+") do
  59. table.insert(args, arg)
  60. end
  61.  
  62. if args[1] == "stats" then
  63. if player == "Tiburoncin23#9884" or player=="Jitotranss#0000" then
  64. ui.addPopup(0, 0, "Puntos de "..args[2]..": "..players[args[2]].score, player, 24, 213, 169, true)
  65.  
  66. end
  67. elseif args[1] == "!!" then
  68. local x = tfm.get.room.playerList[player].x
  69. local y = tfm.get.room.playerList[player].y
  70. name=player
  71. for i=0,20 do
  72. tfm.exec.addShamanObject(17, x-(tfm.get.room.playerList[name].isFacingRight and players[name].offsets.x or -players[name].offsets.x), y+players[name].offsets.y, tfm.get.room.playerList[name].isFacingRight and 90 or 270)
  73. tfm.exec.addShamanObject(17, x-(tfm.get.room.playerList[name].isFacingRight and players[name].offsets.x or -players[name].offsets.x), y+players[name].offsets.y, tfm.get.room.playerList[name].isFacingRight and 90 or 270)
  74. end
  75. end
  76. end
  77.  
  78. function eventLoop(time,remaining)
  79. if time >= 3000 and not started then
  80. started=true
  81.  
  82. elseif time >= 1000 and not started then
  83. ui.removeTextArea(993, nil)
  84. ui.removeTextArea(12,nil)
  85. ui.removeTextArea(2,nil)
  86. end
  87. if remaining<=0 then
  88. tfm.exec.newGame(maps[math.random(#maps)])
  89. end
  90. for i,cannon in ipairs(toDespawn) do
  91. if cannon[1] <= os.time()-3000 then
  92. tfm.exec.removeObject(cannon[2])
  93. table.remove(toDespawn,i)
  94. end
  95. end
  96.  
  97. for name in pairs(tfm.get.room.playerList) do
  98.  
  99. end
  100. end
  101.  
  102.  
  103.  
  104. function eventPlayerDied(name)
  105. ui.removeTextArea(0)
  106. local i=0
  107. local n
  108. for pname,player in pairs(tfm.get.room.playerList) do
  109. if not player.isDead then
  110. i=i+1
  111. n=pname
  112. end
  113. end
  114. if i==0 then
  115. tfm.exec.newGame(maps[math.random(#maps)])
  116. elseif i==1 then
  117. tfm.exec.giveCheese(n)
  118. tfm.exec.playerVictory(n)
  119. tfm.exec.setGameTime(5)
  120. end
  121. end
  122.  
  123. for name,player in pairs(tfm.get.room.playerList) do
  124. eventNewPlayer(name)
  125. end
  126.  
  127. tfm.exec.newGame(maps[math.random(#maps)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement