Tectoon

[TFM] Bootcamp com !Skip e !Map

Aug 1st, 2015
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.17 KB | None | 0 0
  1. maps={"@511136","@3999991","@3547571","@3161324","@3012311","@4317592","@3734991","@3734997","@3750360","@3734998","@3999979","@4390388","@4367270","@3137929","@3547571","@3471016","@2860211","@2967631","@2805938","@3815568","@720672","@3849999","@3551333","@3493490","@3136410","@842019","@3668888","@3850000","@3264848","@2996951","@2805938","@3815568","@720672","@3849999","@3551333","@3493490","@3136410","@842019","@2805938","@3815568","@720672","@3849999","@3551333","@3493490","@3136410","@842019","@3668888","@3850000","@3668877","@3200001","@3483300","@3920916","@3395605","@3386996","@3478040","@4656973","","",""};
  2. tempo=350; -- Tempo em segundos
  3. respawn=1; -- 1 = true    2 = false
  4. adm = {Sagazgamer = true, Tectoon = true}
  5.  
  6. tfm.exec.disableAutoNewGame(true)
  7. tfm.exec.disableAutoShaman(true)
  8. tfm.exec.disableAutoTimeLeft(true)
  9. tfm.exec.newGame(maps[math.random(#maps)])
  10. tfm.exec.setNameColor("Sagazgamer", 0x20ABFF)
  11. tfm.exec.setNameColor("Tectoon", 0xFF3838)
  12. tfm.exec.setUIMapName("<J> Bootcamp1")
  13.  
  14. function eventNewGame()
  15.     tfm.exec.setGameTime(tempo)
  16.     tfm.exec.setUIMapName("<J> Bootcamp1")
  17.     tfm.exec.setNameColor("Sagazgamer", 0x20ABFF)
  18.         tfm.exec.setNameColor("Tectoon", 0xFF3838)
  19. end
  20.  
  21. function eventPlayerDied(p)
  22.     if respawn == 1 then
  23.         tfm.exec.respawnPlayer(p)
  24.         tfm.exec.setNameColor("Sagazgamer", 0x20ABFF)
  25.                 tfm.exec.setNameColor("Tectoon", 0xFF3838)
  26.     else
  27.         local i = 0;
  28.         for v in pairs(tfm.get.room.playerList) do
  29.             i=i+1;
  30.         end
  31.         if i == 0 then
  32.             tfm.exec.newGame(maps[math.random(#maps)])
  33.         end
  34.     end
  35. end
  36.  
  37. function eventPlayerWon(p)
  38.     if respawn == 1 then
  39.         tfm.exec.respawnPlayer(p)
  40.         tfm.exec.setNameColor("Sagazgamer", 0x20ABFF)
  41.                 tfm.exec.setNameColor("Tectoon", 0xFF3838)
  42.     else
  43.         local i = 0;
  44.         for v in pairs(tfm.get.room.playerList) do
  45.             i=i+1;
  46.         end
  47.         if i == 0 then
  48.             tfm.exec.newGame(maps[math.random(#maps)])
  49.         end
  50.     end
  51. end
  52.  
  53. function eventLoop(ct,rt)
  54.     if rt <= 0 then
  55.         tfm.exec.newGame(maps[math.random(#maps)])
  56.         tfm.exec.setUIMapName("<J> Bootcamp1")
  57.         tfm.exec.setNameColor("Sagazgamer", 0x20ABFF)
  58.                 tfm.exec.setNameColor("Tectoon", 0xFF3838)
  59.     end
  60. end
  61.  
  62. function eventChatCommand(p,c)
  63.   local args={}
  64.     for i in c:gmatch('[^%s]+') do
  65.         table.insert(args,i)
  66.     end
  67.   if args[1]=="map" and adm[p] then
  68.     tfm.exec.disableAutoNewGame(true)
  69.     tfm.exec.disableAfkDeath(true)
  70.     tfm.exec.setNameColor("Sagazgamer", 0x20ABFF)
  71.     tfm.exec.setNameColor("Tectoon", 0xFF3838)
  72.     if args[2] then
  73.       tfm.exec.newGame(args[2])
  74.     else
  75.       print("<R>O mapa não existe ou não carrega")
  76.     end
  77.   elseif args[1]=="skip" and adm[p] then
  78.     tfm.exec.newGame(maps[math.random(#maps)])
  79.     tfm.exec.setUIMapName("<J> Bootcamp1")
  80.         tfm.exec.setNameColor("Sagazgamer", 0x20ABFF)
  81.                 tfm.exec.setNameColor("Tectoon", 0xFF3838)
  82.         tfm.exec.setGameTime(tempo)
  83.         print("<J>Próximo mapa<ch> Bootcamp!<n> Mapa carregado com sucesso!")
  84.   end
  85. end
  86.  
  87. function eventNewPlayer(p)
  88.  tfm.exec.respawnPlayer(p)
  89. end
  90.  
  91. for i,command in ipairs({"skip","map"}) do
  92.         system.disableChatCommandDisplay(command)
  93.         end
  94.  
  95. print("<J>Bootcamp <n>carregado com sucesso!")
Advertisement
Add Comment
Please, Sign In to add comment