Advertisement
Hpassospi

[#Thebbalons] The ballons

Mar 25th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. system.bindMouse("Hpassos", true);
  2.  
  3. function eventMouse(playerName, xMouse, yMouse)
  4. tfm.exec.addShamanObject(28, xMouse, yMouse, 0, 0, 0, false);
  5. end
  6.  
  7. ranking={};
  8.  
  9. function estaNaTabela(player)
  10. for i = #ranking,1,-1 do
  11. if ranking == player then
  12. return true;
  13. end
  14. end
  15. return false;
  16. end
  17.  
  18. function verRanking(player)
  19. for i = #ranking,1,-1 do
  20. table.remove(ranking,i)
  21. end
  22. for i = 0,3 do
  23. local score = -1;
  24. local pl = nil;
  25. for p,v in pairs(tfm.get.room.playerList) do
  26. if v.score > score and not estaNaTabela(p) then
  27. score=v.score;
  28. pl=p;
  29. end
  30. end
  31. table.insert(ranking,pl)
  32. end
  33. for i = #ranking,1,-1 do
  34. print(ranking)
  35. end
  36. end
  37.  
  38. verRanking()
  39. tfm.exec.disableAutoNewGame(true);
  40. mapas={"@5016375", "@5016389"}
  41.  
  42. function nextRound()
  43. tfm.exec.newGame(mapas[math.random(#mapas)]);
  44. end
  45.  
  46. function eventNewGame()
  47. vivo=0
  48. for name,player in pairs(tfm.get.room.playerList) do
  49. vivo=vivo+1
  50. end
  51. end
  52.  
  53. function eventPlayerDied(name)
  54. vivo=vivo-1
  55. end
  56.  
  57. function eventPlayerWon(name)
  58. vivo=vivo-1
  59. end
  60.  
  61. function eventLoop(tempoPassado, tempoFaltando)
  62. if vivo == 0 or tempoFaltando < 1000 then
  63. nextRound();
  64. end
  65. end
  66.  
  67. nextRound();
  68. red={}
  69. blue={}
  70. function makeTeams()
  71. local playerList={}
  72. for name,player in pairs(tfm.get.room.playerList) do
  73. table.insert(playerList,name)
  74. end
  75. for i=1,#playerList,1 do
  76. local index=math.random(#playerList)
  77. local name=playerList[index]
  78. if i%2==0 then
  79. table.insert(red,name)
  80. else
  81. table.insert(blue,name)
  82. end
  83. table.remove(playerList,index)
  84. end
  85. end
  86.  
  87. makeTeams()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement