Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.97 KB | None | 0 0
  1. tfm.exec.disableAutoNewGame(true)
  2. tfm.exec.disableAutoShaman(true)
  3. players={}
  4. toDespawn={}
  5. local infinito = 10
  6. 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}
  7.  
  8. function eventNewPlayer(name)
  9. 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);
  10.  
  11.  
  12. for i,key in ipairs({32,40,83}) do
  13. tfm.exec.bindKeyboard(name,key,true,true)
  14. end
  15. players[name]={
  16. timestamp=os.time(),
  17. offsets={x=2, y=10},
  18. score=0
  19. }
  20.  
  21. end
  22.  
  23. function eventKeyboard(name,key,down,x,y)
  24. if (key==32 or key==40 or key==83) and not tfm.get.room.playerList[name].isDead and started then
  25. if players[name].timestamp < os.time()-1000 then
  26. 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)
  27. players[name].timestamp=os.time()
  28. table.insert(toDespawn,{os.time(),id})
  29. end
  30. end
  31. end
  32.  
  33.  
  34. function eventPlayerWon(n)
  35. players[n].score = players[n].score + 1
  36. ui.addTextArea(2, "<font size='15' face='impact'><p align='center'><G>"..n, nil, 300, 60, 190, 21, 0x324650, 0x000000, 0, true)
  37.  
  38.  
  39. 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)
  40. ui.addTextArea(993,"<VI>"..n.." <N>¡Ganó el enfrentamiento!",nil,555,330,nil,nil,0x000000 ,0xFFFFFF,0.5,true)
  41. end
  42. function eventNewGame()
  43. started=false
  44. end
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51. function eventLoop(time,remaining)
  52. if time >= 3000 and not started then
  53. started=true
  54.  
  55. elseif time >= 1000 and not started then
  56. ui.removeTextArea(993, nil)
  57. ui.removeTextArea(12,nil)
  58. ui.removeTextArea(2,nil)
  59. end
  60. if remaining<=0 then
  61. tfm.exec.newGame(maps[math.random(#maps)])
  62. end
  63. for i,cannon in ipairs(toDespawn) do
  64. if cannon[1] <= os.time()-3000 then
  65. tfm.exec.removeObject(cannon[2])
  66. table.remove(toDespawn,i)
  67. end
  68. end
  69.  
  70. for name in pairs(tfm.get.room.playerList) do
  71.  
  72. end
  73. end
  74.  
  75.  
  76.  
  77. function eventPlayerDied(name)
  78. ui.removeTextArea(0)
  79. local i=0
  80. local n
  81. for pname,player in pairs(tfm.get.room.playerList) do
  82. if not player.isDead then
  83. i=i+1
  84. n=pname
  85. end
  86. end
  87. if i==0 then
  88. tfm.exec.newGame(maps[math.random(#maps)])
  89. elseif i==1 then
  90. tfm.exec.giveCheese(n)
  91. tfm.exec.playerVictory(n)
  92. tfm.exec.setGameTime(5)
  93. end
  94. end
  95.  
  96. for name,player in pairs(tfm.get.room.playerList) do
  97. eventNewPlayer(name)
  98. end
  99.  
  100. tfm.exec.newGame(maps[math.random(#maps)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement