Advertisement
GogoTfm

lua Gogo

Feb 25th, 2019
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. mapList = {"@7577773" }
  2.  
  3.  
  4.  
  5. round = 0;
  6. alive = 0;
  7. rank = 1;
  8.  
  9. function main()
  10. tfm.exec.disableAllShamanSkills (true)
  11.  
  12. tfm.exec.disableAutoNewGame(true)
  13. tfm.exec.disableAutoScore(true)
  14. for name in pairs(tfm.get.room.playerList) do
  15. tfm.exec.setPlayerScore(name, 0)
  16. end
  17. launchGame()
  18. end
  19.  
  20.  
  21. function launchGame()
  22. tfm.exec.setGameTime(1)
  23. tfm.exec.newGame(mapList[math.random(#mapList)])
  24. end
  25.  
  26. function eventChatCommand(name, command)
  27. if command=='mort' then tfm.exec.killPlayer(name) end
  28. end
  29.  
  30.  
  31. function eventNewGame()
  32. tfm.exec.setGameTime(120)
  33.  
  34. rank = 1;
  35. alive = 0;
  36. for name in pairs(tfm.get.room.playerList) do alive = alive+1 end
  37.  
  38.  
  39. round=round+1
  40. if round > 10 then
  41. for name in pairs(tfm.get.room.playerList) do
  42. tfm.exec.setPlayerScore(name, 0)
  43. end
  44. round = 1
  45. end
  46.  
  47. tfm.exec.setUIShamanName("<N><font color='#00C8E2'>Round number : <CH>"..round.."/10")
  48. end
  49.  
  50.  
  51. function eventLoop(past, left)
  52. if left<0 then tfm.exec.newGame(mapList[math.random(#mapList)]) end
  53. end
  54.  
  55.  
  56.  
  57. function eventPlayerLeft(name)
  58. alive = alive-1
  59. if alive == 0 then tfm.exec.setGameTime(0) end
  60. end
  61.  
  62.  
  63. function eventPlayerWon(name)
  64. tfm.exec.setPlayerScore(name, rank==1 and 4 or rank==2 and 3 or rank==3 and 2 or 1, true)
  65. rank = rank+1
  66. alive = alive-1
  67. if alive == 0 then tfm.exec.setGameTime(0) end
  68. end
  69.  
  70.  
  71. function eventPlayerDied(name)
  72. alive = alive-1
  73. if alive == 0 then tfm.exec.setGameTime(0) end
  74. end
  75.  
  76. main()
  77. function eventNewGame()
  78. shaman=nil
  79. for name,player in pairs(tfm.get.room.playerList) do
  80. if(tfm.get.room.playerList[name].isShaman) then
  81. shaman=name
  82. print(shaman.." just stole the cheese! CATCH HER!")
  83. tfm.exec.giveCheese(shaman)
  84. end
  85. end
  86. if(shaman==nil) then
  87. print('No shaman found!')
  88. end
  89. end
  90.  
  91. function eventLoop(ct,cr)
  92. if(shaman~=nil) and not tfm.get.room.playerList[shaman].isDead then
  93. local shamanx=tfm.get.room.playerList[shaman].x
  94. local shamany=tfm.get.room.playerList[shaman].y
  95. for name,player in pairs(tfm.get.room.playerList) do
  96. if not tfm.get.room.playerList[name].isShaman then
  97. x=tfm.get.room.playerList[name].x
  98. y=tfm.get.room.playerList[name].y
  99. if x>shamanx-30 and x<shamanx+30 and y>shamany-30 and y<shamany+30 then
  100. tfm.exec.giveCheese(name)
  101. end
  102. end
  103. end
  104. end
  105. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement