Guest User

Treinamento Wj e Kina

a guest
Oct 13th, 2017
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 12.86 KB | None | 0 0
  1. for _, v in next, {'AutoShaman', 'AutoNewGame', 'AfkDeath', 'AutoTimeLeft'} do
  2.     tfm.exec['disable' .. v]()
  3. end
  4.  
  5. local tempo = 0
  6. local Admin = "Hugotitas" -- Aqui vc muda seu nome, dentro das aspas
  7. local cor={"0xffffff","0x00000"}
  8. mapas = {164931,7073393,7098884}
  9. local go=false
  10. local players = {}
  11.  
  12. function setColors()
  13.     for i,v in pairs(tfm.get.room.playerList) do
  14.         if Admin ~= i then
  15.             tfm.exec.setNameColor(i,0x2E2E2E)
  16.         else
  17.             tfm.exec.setNameColor(i,0xFFD100)
  18.         end
  19.     end
  20. end
  21. setColors()
  22.  
  23. function eventNewGame()
  24. code = tfm.get.room.currentMap
  25. if code == '@164931' then
  26. ui.removeTextArea(0,nil)
  27. ui.removeTextArea(3,nil)
  28. ui.removeTextArea(4,nil)
  29. ui.addTextArea(3,"<font size='35'><R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n",nil,643,10,0,1000,0,0,80,false)
  30. elseif code == '@7073393' then
  31. ui.removeTextArea(0,nil)
  32. ui.removeTextArea(3,nil)
  33. ui.removeTextArea(4,nil)
  34. ui.addTextArea(3,"<font size='35'><R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n",nil,611,10,0,1000,0,0,80,false)
  35. elseif code == '@7098884' then
  36. ui.removeTextArea(0,nil)
  37. ui.removeTextArea(3,nil)
  38. ui.addTextArea(3,"<font size='35'><R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n",nil,519,10,0,1000,0,0,80,false)
  39. ui.addTextArea(4,"<font size='35'><R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n<R>|\n<J>|\n",nil,259,10,0,1000,0,0,80,false)
  40. end
  41. end
  42.  
  43. function eventNewPlayer(name)
  44.     ui.addWindow(1, "Player : <V>"..Admin.."", nil, 665, 28, 130, 28, 1, true,false, "Fechar")
  45.     ui.addTextArea(1,"<font size='14'><a href='event:m'>Mudar Jogador : ",Admin,5,28,0,0,0x153139,0x132C33,1,true)
  46.    
  47.     table.insert(players, name)
  48. end
  49.  
  50. function eventPlayerLeft(name)
  51.     for k, v in ipairs(players) do
  52.         if name == v then
  53.             table.remove(players, k)
  54.         end
  55.     end
  56. end
  57.  
  58. function eventTextAreaCallback(id,name,call)
  59.     if call == "m" then
  60.         ui.addTextArea(2,"Jogadores : <VI>\n"..table.concat(players, '\n').."</VI>\n<R>________________</R>\n\n<B><a href='event:nome'>Nome</a></B> | <B><a href='event:a'>Aleatório</B>",Admin,5,60,120,nil,0x153139,0x132C33,1,true)
  61.     end
  62.     if call == "nome" then
  63.         ui.addPopup(0,2,"            Nome do Jogador :",Admin,344,100,200,true)
  64.     end
  65.     if call == "a" then
  66.         Admin = players[math.random(#players)]
  67.  
  68.         ui.removeTextArea(1, name)
  69.         ui.removeTextArea(2, name)
  70.            
  71.     ui.addWindow(1, "Player : <V>"..Admin.."", nil, 665, 28, 130, 28, 1, true,false, "Fechar")
  72.         ui.addTextArea(1,"<font size='14'><a href='event:m'>Mudar Jogador : ",Admin,5,28,0,0,0x153139,0x132C33,1,true)
  73.         setColors()
  74.     end
  75. end
  76.  
  77. function eventPlayerWon(name)
  78.     go=false
  79.     tfm.exec.playerVictory(name)
  80. end
  81.  
  82. function ui.addWindow(id, text, player, x, y, width, height, alpha, corners, closeButton, buttonText)
  83.     id = tostring(id)
  84.     ui.addTextArea(id.."000000000", "", player, x, y, width, height, 0x573926, 0x573926, alpha, true)
  85.     ui.addTextArea(id.."0", "", player, x+1, y+1, width-2, height-2, 0x8a583c, 0x8a583c, alpha, true)
  86.     ui.addTextArea(id.."00", "", player, x+3, y+3, width-6, height-6, 0x2b1f19, 0x2b1f19, alpha, true)
  87.     ui.addTextArea(id.."000", "", player, x+4, y+4, width-8, height-8, 0xc191c, 0xc191c, alpha, true)
  88.     ui.addTextArea(id.."0000", "", player, x+5, y+5, width-10, height-10, 0x2d5a61, 0x2d5a61, alpha, true)
  89.     ui.addTextArea(id.."00000", text, player, x+5, y+6, width-10, height-12, 0x142b2e, 0x142b2e, alpha, true)
  90.     local imageId = {}
  91.     if corners then
  92.         table.insert(imageId, tfm.exec.addImage("155cbe97a3f.png", "&1", x-7, (y+height)-22, player))
  93.         table.insert(imageId, tfm.exec.addImage("155cbe99c72.png", "&1", x-7, y-7, player))
  94.         table.insert(imageId, tfm.exec.addImage("155cbe9bc9b.png", "&1", (x+width)-20, (y+height)-22, player))
  95.         table.insert(imageId, tfm.exec.addImage("155cbea943a.png", "&1", (x+width)-20, y-7, player))
  96.     end
  97.     if closeButton then
  98.         ui.addTextArea(id.."000000", "", player, x+8, y+height-22, width-16, 13, 0x7a8d93, 0x7a8d93, alpha, true)
  99.         ui.addTextArea(id.."0000000", "", player, x+9, y+height-21, width-16, 13, 0xe1619, 0xe1619, alpha, true)
  100.         ui.addTextArea(id.."00000000", "", player, x+9, y+height-21, width-17, 12, 0x314e57, 0x314e57, alpha, true)
  101.         ui.addTextArea(id.."", buttonText, player, x+9, y+height-24, width-17, nil, 0x314e57, 0x314e57, 0, true)
  102.     end
  103.     return imageId
  104. end
  105.  
  106.  
  107. function eventLoop()
  108.     if go then
  109.         tempo = tempo + 0.5
  110.  
  111.         if not tostring(tempo):find('.5') then
  112.             ui.addTextArea(0,"<font size='35'><J><p align='center'>"..tempo,nil,364,360,70,70,0x000001,1,80,true)
  113.         end
  114.     end
  115. end
  116.  
  117. function eventPopupAnswer(id,name,r)
  118.     if id == 0 then
  119.         if r then
  120.             nome = r:lower():gsub('%a', string.upper, 1)
  121.         end
  122.  
  123.         if tfm.get.room.playerList[nome] then
  124.             ui.removeTextArea(2,name)
  125.             ui.removeTextArea(1,name)
  126.  
  127.             Admin = nome
  128.             ui.addTextArea(1,"<font size='14'><a href='event:m'>Mudar Jogador : ",nome,5,28,0,0,0x153139,0x132C33,1,true)
  129.     ui.addWindow(1, "Player : <V>"..Admin.."", nil, 665, 28, 130, 28, 1, true,false, "Fechar")
  130.  
  131.             setColors()
  132.         else
  133.             ui.addPopup(0,3,"<font  size ='14' color='#FF00DE'>[•]</font><font color='#FED000' size='14'> O jogador <font color='#00F9FE'>"..nome.."</font> não se encontra na sala.",name,300,200,300,true)
  134.         end
  135.     end
  136. end
  137.  
  138. function eventChatCommand(name,cmd)
  139.     if name == Admin then
  140.         if cmd == "t_madeira" then
  141.             tempo = 0
  142.             go=true
  143.  
  144.             tfm.exec.newGame('<C><P F="2" Ca="" /><Z><S><S L="800" X="400" H="27" Y="387" T="6" P="0,0,0.3,0.2,0,0,0,0" /><S L="22" H="375" X="276" Y="188" T="1" m="" P="0,0,0,0.2,0,0,0,0" /><S L="27" H="327" X="464" Y="212" T="0" P="0,0,0.3,0.2,0,0,0,0" /><S L="22" X="812" H="375" Y="186" T="1" m="" P="0,0,0,0.2,0,0,0,0" /><S P="0,0,0,0.2,0,0,0,0" L="22" X="-10" Y="192" T="1" m="" H="375" /></S><D><P X="32" Y="486" T="1" P="0,0" /><P X="37" Y="435" T="1" P="0,0" /><P X="71" Y="477" T="1" P="0,0" /><P X="775" Y="482" T="1" P="0,0" /><P X="781" Y="406" T="1" P="0,0" /><P X="752" Y="474" T="1" P="0,0" /><F Y="32" X="462" /><DS Y="358" X="77" /><T Y="41" X="464" /></D><O /></Z></C>')
  145.             ui.setMapName("Treinamento_Madeira")
  146.             tfm.exec.movePlayer(name,394,354,false,0,0,false)
  147.             ui.removeTextArea(3,nil)
  148.             ui.removeTextArea(4,nil)
  149.  
  150.             for k,v in pairs(tfm.get.room.playerList) do
  151.                 if k ~= Admin then
  152.                     tfm.exec.killPlayer(k)
  153.                 end
  154.             end
  155.         end
  156.     end
  157.     if name == Admin then
  158.         if cmd == "t_chocolate" then
  159.             tempo = 0
  160.             go=true
  161.  
  162.             tfm.exec.newGame('<C><P F="2" Ca="" /><Z><S><S L="800" X="400" H="27" Y="387" T="6" P="0,0,0.3,0.2,0,0,0,0" /><S L="22" X="276" H="375" Y="188" T="1" m="" P="0,0,0,0.2,0,0,0,0" /><S L="22" H="375" X="812" Y="186" T="1" m="" P="0,0,0,0.2,0,0,0,0" /><S P="0,0,0,0.2,0,0,0,0" L="22" H="375" Y="192" T="1" m="" X="-10" /><S L="27" H="327" X="462" Y="213" T="4" P="0,0,20,0.2,0,0,0,0" /></S><D><P X="32" Y="486" T="1" P="0,0" /><P X="37" Y="435" T="1" P="0,0" /><P X="71" Y="477" T="1" P="0,0" /><P X="775" Y="482" T="1" P="0,0" /><P X="781" Y="406" T="1" P="0,0" /><P X="752" Y="474" T="1" P="0,0" /><F Y="32" X="462" /><DS Y="358" X="77" /><T Y="38" X="463" /></D><O /></Z></C>')
  163.             ui.setMapName("Treinamento_Chocolate")
  164.             tfm.exec.movePlayer(name,394,354,false,0,0,false)
  165.             ui.removeTextArea(3,nil)
  166.             ui.removeTextArea(4,nil)
  167.  
  168.             for k,v in pairs(tfm.get.room.playerList) do
  169.                 if k ~= Admin then
  170.                     tfm.exec.killPlayer(k)
  171.                 end
  172.             end
  173.         end
  174.     end
  175. if name == Admin then
  176.         if cmd == "t_terra" then
  177.             tempo = 0
  178.             go=true
  179.  
  180.             tfm.exec.newGame('<C><P F="2" Ca="" /><Z><S><S L="800" H="27" X="400" Y="387" T="6" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0,0.2,0,0,0,0" L="22" H="375" Y="188" T="1" m="" X="276" /><S P="0,0,0,0.2,0,0,0,0" L="22" X="812" Y="186" T="1" m="" H="375" /><S L="22" H="375" X="-10" Y="192" T="1" m="" P="0,0,0,0.2,0,0,0,0" /><S L="27" X="462" H="322" Y="210" T="5" P="0,0,0.3,0.2,0,0,0,0" /></S><D><P P="0,0" Y="486" T="1" X="32" /><P P="0,0" Y="435" T="1" X="37" /><P P="0,0" Y="477" T="1" X="71" /><P P="0,0" Y="482" T="1" X="775" /><P P="0,0" Y="406" T="1" X="781" /><P P="0,0" Y="474" T="1" X="752" /><F Y="37" X="460" /><DS Y="358" X="77" /><T Y="44" X="459" /></D><O /></Z></C>')
  181.             ui.setMapName("Treinamento_Terra")
  182.             tfm.exec.movePlayer(name,394,354,false,0,0,false)
  183.             ui.removeTextArea(3,nil)
  184.             ui.removeTextArea(4,nil)
  185.  
  186.             for k,v in pairs(tfm.get.room.playerList) do
  187.                 if k ~= Admin then
  188.                     tfm.exec.killPlayer(k)
  189.                 end
  190.             end
  191.         end
  192.     end
  193. if name == Admin then
  194.         if cmd == "t_grama" then
  195.             tempo = 0
  196.             go=true
  197.  
  198.             tfm.exec.newGame('<C><P F="2" Ca="" /><Z><S><S L="800" H="27" X="400" Y="387" T="6" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0,0.2,0,0,0,0" L="22" H="375" Y="188" T="1" m="" X="276" /><S P="0,0,0,0.2,0,0,0,0" L="22" X="812" Y="186" T="1" m="" H="375" /><S L="22" H="375" X="-10" Y="192" T="1" m="" P="0,0,0,0.2,0,0,0,0" /><S L="29" X="464" H="324" Y="212" T="6" P="0,0,0.3,0.2,0,0,0,0" /></S><D><P P="0,0" Y="486" T="1" X="32" /><P P="0,0" Y="435" T="1" X="37" /><P P="0,0" Y="477" T="1" X="71" /><P P="0,0" Y="482" T="1" X="775" /><P P="0,0" Y="406" T="1" X="781" /><P P="0,0" Y="474" T="1" X="752" /><F Y="37" X="460" /><DS Y="358" X="77" /><T Y="44" X="462" /></D><O /></Z></C>')
  199.             ui.setMapName("Treinamento_Grama")
  200.             tfm.exec.movePlayer(name,394,354,false,0,0,false)
  201.             ui.removeTextArea(3,nil)
  202.             ui.removeTextArea(4,nil)
  203.  
  204.             for k,v in pairs(tfm.get.room.playerList) do
  205.                 if k ~= Admin then
  206.                     tfm.exec.killPlayer(k)
  207.                 end
  208.             end
  209.         end
  210.     end
  211. if name == Admin then
  212.         if cmd == "t_areia" then
  213.             tempo = 0
  214.             go=true
  215.  
  216.             tfm.exec.newGame('<C><P F="2" Ca="" /><Z><S><S L="800" H="27" X="400" Y="387" T="6" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0,0.2,0,0,0,0" L="22" H="375" Y="188" T="1" m="" X="276" /><S P="0,0,0,0.2,0,0,0,0" L="22" X="812" Y="186" T="1" m="" H="375" /><S L="22" H="375" X="-10" Y="192" T="1" m="" P="0,0,0,0.2,0,0,0,0" /><S L="28" X="465" H="324" Y="213" T="7" P="0,0,0.1,0.2,0,0,0,0" /></S><D><P P="0,0" Y="486" T="1" X="32" /><P P="0,0" Y="435" T="1" X="37" /><P P="0,0" Y="477" T="1" X="71" /><P P="0,0" Y="482" T="1" X="775" /><P P="0,0" Y="406" T="1" X="781" /><P P="0,0" Y="474" T="1" X="752" /><F Y="37" X="460" /><DS Y="358" X="77" /><T Y="44" X="462" /></D><O /></Z></C>')
  217.             ui.setMapName("Treinamento_Areia")
  218.             tfm.exec.movePlayer(name,394,354,false,0,0,false)
  219.             ui.removeTextArea(3,nil)
  220.             ui.removeTextArea(4,nil)
  221.  
  222.             for k,v in pairs(tfm.get.room.playerList) do
  223.                 if k ~= Admin then
  224.                     tfm.exec.killPlayer(k)
  225.                 end
  226.             end
  227.         end
  228.     end
  229. if name == Admin then
  230.         if cmd == "t_pedra" then
  231.             tempo = 0
  232.             go=true
  233.  
  234.             tfm.exec.newGame('<C><P F="2" Ca="" /><Z><S><S L="800" H="27" X="400" Y="387" T="6" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0,0.2,0,0,0,0" L="22" X="276" Y="188" T="1" m="" H="375" /><S P="0,0,0,0.2,0,0,0,0" L="22" H="375" Y="186" T="1" m="" X="812" /><S L="22" X="-10" H="375" Y="192" T="1" m="" P="0,0,0,0.2,0,0,0,0" /><S L="28" H="322" X="466" Y="214" T="10" P="0,0,0.3,0,0,0,0,0" /></S><D><P P="0,0" Y="486" T="1" X="32" /><P P="0,0" Y="435" T="1" X="37" /><P P="0,0" Y="477" T="1" X="71" /><P P="0,0" Y="482" T="1" X="775" /><P P="0,0" Y="406" T="1" X="781" /><P P="0,0" Y="474" T="1" X="752" /><F Y="37" X="460" /><DS Y="358" X="77" /><T Y="45" X="462" /></D><O /></Z></C>')
  235.             ui.setMapName("Treinamento_Pedra")
  236.             tfm.exec.movePlayer(name,394,354,false,0,0,false)
  237.             ui.removeTextArea(3,nil)
  238.             ui.removeTextArea(4,nil)
  239.  
  240.             for k,v in pairs(tfm.get.room.playerList) do
  241.                 if k ~= Admin then
  242.                     tfm.exec.killPlayer(k)
  243.                 end
  244.             end
  245.         end
  246.     end
  247. if name == Admin then
  248.         if cmd == "t_neve" then
  249.             tempo = 0
  250.             go=true
  251.  
  252.             tfm.exec.newGame('<C><P F="2" Ca="" /><Z><S><S L="800" H="27" X="400" Y="387" T="6" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0,0.2,0,0,0,0" L="22" X="276" Y="188" T="1" m="" H="375" /><S P="0,0,0,0.2,0,0,0,0" L="22" H="375" Y="186" T="1" m="" X="812" /><S L="22" X="-10" H="375" Y="192" T="1" m="" P="0,0,0,0.2,0,0,0,0" /><S L="27" X="463" H="319" Y="214" T="11" P="0,0,0.05,0.1,0,0,0,0" /></S><D><P P="0,0" Y="486" T="1" X="32" /><P P="0,0" Y="435" T="1" X="37" /><P P="0,0" Y="477" T="1" X="71" /><P P="0,0" Y="482" T="1" X="775" /><P P="0,0" Y="406" T="1" X="781" /><P P="0,0" Y="474" T="1" X="752" /><F Y="37" X="460" /><DS Y="358" X="77" /><T Y="47" X="459" /></D><O /></Z></C>')
  253.             ui.setMapName("Treinamento_Neve")
  254.             tfm.exec.movePlayer(name,394,354,false,0,0,false)
  255.             ui.removeTextArea(3,nil)
  256.             ui.removeTextArea(4,nil)
  257.  
  258.             for k,v in pairs(tfm.get.room.playerList) do
  259.                 if k ~= Admin then
  260.                     tfm.exec.killPlayer(k)
  261.                 end
  262.             end
  263.         end
  264.     end
  265. if name == Admin then
  266.         if cmd == "t_kina" then
  267.             tfm.exec.newGame(mapas[math.random(#mapas)])
  268.         end
  269.     end
  270. end
  271.  
  272. for all in pairs(tfm.get.room.playerList) do
  273.     eventNewPlayer(all)
  274. end
Add Comment
Please, Sign In to add comment