Advertisement
Tectoon

[TFM] Treinamento Shaman V1.0

Aug 23rd, 2015
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.64 KB | None | 0 0
  1. admin =                 {       "Tectoon", "Theapps", "Sagazgamer" }
  2. local tempo=1;
  3. tfm.exec.disableAutoNewGame(true)
  4. tfm.exec.disableAutoShaman(true)
  5. tfm.exec.disableAutoScore(true)
  6.  
  7. local alive = 0
  8. local maxscore = 0
  9. local won = 0
  10. local sh = 2
  11.  
  12. maps = {[[@1703644]], [[@360778]], [[@183740]], [[@4624694]], [[@2065627]], [[@1474189]], [[@1482964]], [[@626107]], [[@4530334]], [[@2593758]], [[@524924]]}
  13.  
  14. eventNewGame = function()
  15.     sh = 2
  16.     alive = 0
  17.     maxscore = 0
  18.     for i in pairs(tfm.get.room.playerList) do
  19.         alive = alive + 1
  20.         for l = 1,2 do
  21.             if tfm.get.room.playerList[i].score < maxscore + 1 and sh ~= 0 then
  22.                 sh = sh - 1
  23.                 tfm.exec.setShaman(i)
  24.                 tfm.exec.setPlayerScore(i, 0, false)
  25.                 if sh == 1 then
  26.                     tfm.exec.setNameColor(i, 0xFFAB35) ------- Aonde está FFAB35 você mude para outro código, outra cor, que será a cor do shaman
  27.                     tfm.exec.setUIMapName("Treinamento Shaman V1.0")
  28.                 end
  29.             end
  30.         end
  31.     end
  32. end
  33.  
  34. eventPlayerWon = function(p)
  35.     alive = alive - 1
  36.     if not tfm.get.room.playerList[p].isShaman == true then
  37.         won = won + 1
  38.         tfm.exec.setPlayerScore(p, 10, true)
  39.         if won == 1 then
  40.             maxscore = maxscore + 10
  41.         end
  42.     end
  43. end
  44.  
  45. eventPlayerDied = function(p)
  46.     alive = alive - 1
  47. end
  48.  
  49. eventLoop = function(tp, tr)
  50.     if tr < 100 or alive == 0 then
  51.         eventNextGame()
  52.     end
  53. end
  54.  
  55. eventNextGame = function(m)
  56.     if m then
  57.         tfm.exec.newGame(m)
  58.     elseif not m then
  59.         tfm.exec.newGame(maps[math.random(#maps)])
  60.     end
  61. end
  62.  
  63. parametre =     { ["Tempo automático"] = true }
  64.  
  65.  
  66. aff =           { lJoueurs = {} , joueur = {}
  67.                                 }
  68.  
  69.  
  70. joueur =         {}
  71.  
  72. for k, pseudo in pairs(admin) do
  73.                 ui.addTextArea (1, "<p align='center'><b><a href='event:time'>Time</a></b></p>", pseudo, 61, 30, 40, 20, 0xC06F6E, 0x324650, 0.75, true)
  74.                 ui.addTextArea (4, "<p align='center'><b><a href='event:map'>Mapa</a></b></p>", pseudo, 10, 30, 40, 20, 0x000000, 0x324650, 0.5, true)
  75.                
  76.                 for l, m in pairs ( aff ) do
  77.                         aff[l][pseudo] = false
  78.  
  79.                 end
  80. end
  81.  
  82.  
  83.  
  84. function eventTextAreaCallback(id, source, callback)
  85.  
  86.                 if callback == 'time' then
  87.    
  88.                         ui.addPopup (0, 2, "Tempo para definir:", source, 10, 70, 150, true)
  89.  
  90.  elseif callback == 'map' then  
  91.  
  92.                         ui.addPopup (1, 2, "Código do Mapa:", source, 10, 70, 150, true)
  93.  
  94.                 elseif parametre[callback] ~= nil then
  95.  
  96.                         paraGestion(callback,  source )
  97.                         ui.updateTextArea (id, callback .. ": <a href='event:" .. callback .. "'>" .. B(parametre[callback]) .. "</a>", source )
  98.    
  99.  
  100.                 elseif joueur[callback] ~= nil or callback == "Nomes" then
  101.    
  102.                         if aff["joueur"][source] then
  103.                                 effJoueur ( source )
  104.                                 if callback ~= dernierProfil[source] then
  105.                                         eventTextAreaCallback(id, source, callback)
  106.                                 end
  107.  
  108.                         else
  109.                                 affJoueur(source, callback)
  110.                                 ui.updateTextArea (id, "<p align='center'><b><V><a href='event:" .. callback .. "'>" .. callback .. "</a></N></b></p>", source)
  111.                         end
  112.    
  113.                         dernierProfil[source] = callback
  114.  
  115.                 elseif parametreJ[callback] ~= nil then
  116.                         if dernierProfil[source] == "all" then
  117.  
  118.                                 for k, v in pairs ( joueur ) do
  119.                                         if all[callback] ~= nil then
  120.                                                 joueur[k][callback] = all[callback]
  121.                                         end
  122.    
  123.                                         paraJGestion ( k, callback )
  124.                                 end
  125.  
  126.                         end
  127.  
  128.    
  129.                 end
  130.    
  131. end
  132.  
  133. function eventPopupAnswer (id, playerName, answer)
  134.  
  135.                 if id == 0 then
  136.                         tfm.exec.setGameTime(answer, true)
  137.    
  138.  
  139. elseif id == 1 then
  140.                         tfm.exec.newGame(answer)
  141.  
  142.    
  143.                 end
  144. end
  145.  
  146. function eventChatCommand(p,c)
  147.  if c==[[skip]] and p==[[Sagazgamer]] then
  148.                 tfm.exec.newGame(maps[math.random(#maps)])
  149.                 print("<J>Treinamento Shaman<ch> V1.0<n> <r>Novo mapa Carregado!")
  150.  
  151.  elseif c==[[mort]] then
  152.                 tfm.exec.killPlayer(p)
  153.  end
  154. end
  155.  
  156. for i,command in ipairs({"skip","mort"}) do
  157.         system.disableChatCommandDisplay(command)
  158.         end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement