Bolodefchoco_LUAXML

[Script] Rotação de Mapas

May 27th, 2016
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. --Creator: Bolodefchoco
  2. --Made in: 27/05/2016
  3. --Last update: 27/05/2016
  4. --[[ Notes:
  5.     Does:
  6.         Uma rotação automática sem usar função.
  7. ]]--
  8.  
  9. TIME_PERMAP = 2.5 --< Altere 2.5 (2m e 30s) para o tempo que cada mapa deverá começar
  10.  
  11. maps = {0,1,2,3} --< Introduza todos os mapas aqui
  12.  
  13. tfm.exec.disableAutoNewGame()
  14.  
  15. system.players=function()
  16.     local alive,players = {},{}
  17.     for k,v in next,tfm.get.room.playerList do
  18.         if not v.isDead then
  19.             alive[#alive+1]=k
  20.         end
  21.         players[#players+1]=k
  22.     end
  23.     return alive,players
  24. end
  25.  
  26. eventLoop=function(time)
  27.     local alive = system.players()
  28.     if time <= 0 or #alive < 1 then
  29.         local lastMap = currentMap or 0
  30.         repeat currentMap = maps[math.random(#maps)] until currentMap ~= lastMap
  31.         tfm.exec.newGame(currentMap)
  32.     end
  33. end
  34.  
  35. eventNewGame=function()
  36.     tfm.exec.setGameTime(TIME_PERMAP*60)
  37. end
  38.  
  39. eventLoop(-1)
Advertisement
Add Comment
Please, Sign In to add comment