Advertisement
Tectoon

[TFM] Galeria de Mapas V1.3

Dec 19th, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.96 KB | None | 0 0
  1. local bootcampMaps = {6398045}
  2. local racingMaps = {6395534, 6384010, 6383942, 6378096, 6372293, 6368140, 6368111, 6365172, 6363386, 6360719, 6360663, 6354900, 6349964, 6349395}
  3. local normalMaps = {6399152, 6392584, 6384038, 6375526, 6371998, 6368222, 6368059, 6368031, 6363815, 6363607, 6362517, 6360872, 6360773, 6360739, 6360479, 6360252, 6348132}
  4. local survivorMaps = {6393592, 6366608, 6351808}
  5. local trollMaps = {6376011}
  6. local miniGame
  7.  
  8. ui.addTextArea(1, "<a href='event:click'>Comandos</a>", nil, 0, 380, 0, 0, 0x1C3C41, 0, 1, true)
  9.  
  10. function eventTextAreaCallback(id, name, event)
  11.         if event == "click" then
  12.         ui.addPopup (1, 0, "<font size='20'>Comandos:</font><BR>• <B>!racing</B> Maps Racing.<BR>• <B>!bootcamp</B> Maps Bootcamp<BR>• <B>!normal</B> Maps Normal.<BR>• <B>!exit</B> Para fechar a script.<BR>• <B>!next</B> Para executar o próximo Mapa.<BR>", name, 250, 140, 300, true)
  13.     end
  14. end
  15.  
  16. function eventChatCommand (name, command)
  17.     tfm.exec.disableAutoShaman(true)
  18.     if command == "racing" then
  19.         miniGame = command
  20.         playRacing()
  21.     else if command == "bootcamp" then
  22.         miniGame = command
  23.         playBootcamp()
  24.     else if command == "normal" then
  25.         miniGame = command
  26.         playNormal()
  27.     else if command == "survivor" then
  28.         miniGame = command
  29.         playSurvivor()
  30.     else if command == "exit" then
  31.         system.exit()
  32.     else if command == "next" then
  33.         if miniGame == "bootcamp" then
  34.             playBootcamp()
  35.         else if miniGame == "racing" then
  36.             playRacing()
  37.         else if miniGame == "normal" then
  38.             playNormal()
  39.         else if miniGame == "survivor" then
  40.             playSurvivor()
  41.         else if miniGame == "troll" then
  42.             playTroll()
  43.         end
  44. end
  45. end
  46. end
  47. end
  48. end
  49. end
  50. end
  51. end
  52. end
  53. end
  54. end
  55. function playRacing()
  56.         local newMap
  57.         repeat
  58.             newMap = math.random(#racingMaps)
  59.         until newMap ~= currentMap
  60.         currentMap = newMap
  61.         tfm.exec.newGame(racingMaps[newMap])
  62.         tfm.exec.setGameTime (60)
  63.         tfm.exec.disableAutoNewGame(true)
  64.         tfm.exec.disableAutoTimeLeft()
  65. end
  66.  
  67. function playBootcamp()
  68.         local newMap
  69.         repeat
  70.             newMap = math.random(#bootcampMaps)
  71.         until newMap ~= currentMap
  72.         currentMap = newMap
  73.         tfm.exec.newGame(bootcampMaps[newMap])
  74.         tfm.exec.setGameTime (300)
  75.         tfm.exec.disableAutoNewGame(true)
  76.         tfm.exec.disableAfkDeath()
  77.         tfm.exec.disableAutoTimeLeft()
  78. end
  79.  
  80. function playNormal()
  81.         local newMap
  82.         repeat
  83.             newMap = math.random(#normalMaps)
  84.         until newMap ~= currentMap
  85.         currentMap = newMap
  86.         tfm.exec.newGame(normalMaps[newMap])
  87.         tfm.exec.setGameTime (120)
  88.         tfm.exec.disableAutoTimeLeft()
  89. end
  90.  
  91. function playSurvivor()
  92.         local newMap
  93.         repeat
  94.             newMap = math.random(#survivorMaps)
  95.             until newMap ~= currentMap
  96.             currentMap = newMap
  97.             tfm.exec.newGame(survivorMaps[newMap])
  98.             tfm.exec.setGameTime (120)
  99.             tfm.exec.disableAutoTimeLeft()
  100. end
  101.  
  102. function playTroll()
  103.         local newMap
  104.         repeat
  105.             newMap = math.random(#survivorMaps)
  106.             until newMap ~= currentMap
  107.             currentMap = newMap
  108.             tfm.exec.newGame(survivorMaps[newMap])
  109.             tfm.exec.setGameTime (120)
  110.             tfm.exec.disableAutoTimeLeft()
  111. end
  112.  
  113. function eventNewGame()
  114.     playersAlive = 0
  115.     for _ in pairs(tfm.get.room.playerList) do
  116.     playersAlive = playersAlive + 1
  117.     end
  118. end
  119.  
  120. function eventPlayerDied (name)
  121.         if miniGame == "bootcamp" then
  122.             tfm.exec.respawnPlayer (name)
  123.         else if miniGame == "racing" then
  124.             playersAlive = playersAlive - 1
  125.             checkPlayers()
  126.         end
  127.         end
  128. end
  129.  
  130. function eventPlayerWon (name)
  131.         if miniGame == "bootcamp" then
  132.             tfm.exec.respawnPlayer (name)
  133.         else if miniGame == "racing" then
  134.             playersAlive = playersAlive - 1
  135.             checkPlayers()
  136.         end
  137.         end
  138. end
  139.  
  140. function checkPlayers()
  141.         if playersAlive == 0 then
  142.             playRacing()
  143.         end
  144. end
  145.  
  146. function eventNewPlayer (name)
  147.         if miniGame == "bootcamp" then
  148.             tfm.exec.respawnPlayer (name)
  149.         end
  150. end
  151.  
  152. function eventLoop(t, tr)
  153.     if tr <= 0 and miniGame == "racing" then
  154.             playRacing()
  155.         else if tr <= 0 and miniGame == "bootcamp" then
  156.             playBootcamp()
  157.         end
  158. end
  159. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement