Advertisement
Guest User

Rotação de mapas Vanilla - Transformice Module API

a guest
Jul 31st, 2014
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. tfm.exec.disableAutoNewGame(true)
  2.  
  3. vanilla = {}
  4.  
  5. for i = 0,143 do
  6.     table.insert(vanilla, i)
  7. end
  8.  
  9. for i = 200,210 do
  10.     table.insert(vanilla, i)
  11. end
  12.  
  13. function eventLoop(curTime, timeRem)
  14.     if timeRem <= 0 then
  15.         tfm.exec.newGame(vanilla[math.random(#vanilla)])
  16.     end
  17. end
  18.  
  19. function eventPlayerDied(playerName)
  20.     local p = 0
  21.     for k,v in pairs(tfm.get.room.playerList) do
  22.         if not v.isDead then
  23.             p = p + 1
  24.         end
  25.     end
  26.     if p == 0 then
  27.         tfm.exec.newGame(vanilla[math.random(#vanilla)])
  28.     end
  29. end
  30.  
  31. function eventPlayerLeft(playerName)
  32.     eventPlayerDied(playerName)
  33. end
  34.  
  35. function eventPlayerWon(playerName)
  36.     eventPlayerDied(playerName)
  37. end
  38.  
  39. tfm.exec.newGame(vanilla[math.random(#vanilla)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement