Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. --Parameters
  2. roundTime = 60 --seconds
  3. allDeadTime = 5 --seconds
  4. numberOfRounds = 10
  5. maxScore = 30
  6. scoreAdd={3,2,1} --score for first, second, etc. (list can be any length)
  7. --
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15. round=0
  16.  
  17. for k,v in pairs(tfm.get.room.playerList) do
  18. tfm.exec.setPlayerScore(k,0)
  19. end
  20.  
  21. function eventPlayerDied(name)
  22. nPlayers=nPlayers-1
  23. if nPlayers<1 then tfm.exec.setGameTime(allDeadTime) end
  24. end
  25.  
  26. function eventPlayerWon(name)
  27. nWinners=nWinners+1
  28. if nWinners<=#scoreAdd then
  29. tfm.exec.setPlayerScore(name,scoreAdd[nWinners],true)
  30. end
  31. nPlayers=nPlayers-1
  32. if nPlayers<1 then tfm.exec.setGameTime(allDeadTime) end
  33. end
  34.  
  35. function eventNewGame()
  36. tfm.exec.setGameTime(roundTime)
  37. nWinners=0
  38. round=round+1
  39. nPlayers=0
  40. for k,v in pairs(tfm.get.room.playerList) do
  41. nPlayers=nPlayers+1
  42. end
  43. end
  44.  
  45. function eventLoop(ct,tr)
  46. if tr<1 then
  47. max=0
  48. for name,v in pairs(tfm.get.room.playerList) do
  49. score=tfm.get.room.playerList[name].score
  50. if score>max then max=score end
  51. end
  52. if round<numberOfRounds and max<maxScore then
  53. tfm.exec.newGame("#17")
  54. end
  55. end
  56. end
  57.  
  58.  
  59. tfm.exec.disableAutoShaman(true)
  60. tfm.exec.disableAutoNewGame(true)
  61. tfm.exec.disableAutoTimeLeft(true)
  62. tfm.exec.disableAutoScore(true)
  63. tfm.exec.newGame("#17")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement