Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Parameters
- roundTime = 60 --seconds
- allDeadTime = 5 --seconds
- numberOfRounds = 10
- maxScore = 30
- scoreAdd={3,2,1} --score for first, second, etc. (list can be any length)
- --
- round=0
- for k,v in pairs(tfm.get.room.playerList) do
- tfm.exec.setPlayerScore(k,0)
- end
- function eventPlayerDied(name)
- nPlayers=nPlayers-1
- if nPlayers<1 then tfm.exec.setGameTime(allDeadTime) end
- end
- function eventPlayerWon(name)
- nWinners=nWinners+1
- if nWinners<=#scoreAdd then
- tfm.exec.setPlayerScore(name,scoreAdd[nWinners],true)
- end
- nPlayers=nPlayers-1
- if nPlayers<1 then tfm.exec.setGameTime(allDeadTime) end
- end
- function eventNewGame()
- tfm.exec.setGameTime(roundTime)
- nWinners=0
- round=round+1
- nPlayers=0
- for k,v in pairs(tfm.get.room.playerList) do
- nPlayers=nPlayers+1
- end
- end
- function eventLoop(ct,tr)
- if tr<1 then
- max=0
- for name,v in pairs(tfm.get.room.playerList) do
- score=tfm.get.room.playerList[name].score
- if score>max then max=score end
- end
- if round<numberOfRounds and max<maxScore then
- tfm.exec.newGame("#17")
- end
- end
- end
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.disableAutoScore(true)
- tfm.exec.newGame("#17")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement