Advertisement
Tectoon

[TFM] Racing com Senha

May 1st, 2015
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.83 KB | None | 0 0
  1. admins = {"Tectoon"}
  2. version = 1.0
  3.  
  4. tfm.exec.disableAutoShaman(true);
  5. tfm.exec.disableAfkDeath(true)
  6. tfm.exec.disableAutoNewGame(true)
  7.  
  8. function eventLoop(timePassed, timeLeft)
  9.     if timeLeft < 500 or aliveMice == 0 then
  10.         doNextMap();
  11.     end
  12.     for i = 1, 100 do
  13.         for p in pairs(tfm.get.room.playerList) do
  14.         end
  15.     end
  16. end    
  17.  
  18. function doNextMap()
  19.     tfm.exec.newGame(maplist[math.random(#maplist)]);
  20. end
  21.  
  22. print("<J>Bem vindo ao <b>Evento Racing</b>, para mais informações <i>!help</i>, estamos na versão "..version..".")
  23.      
  24. function eventPlayerDied(pn)
  25.     aliveMice = aliveMice-1
  26. end
  27.      
  28. function eventPlayerWon(pn)
  29.     aliveMice = aliveMice-1
  30. end
  31.  
  32. tfm.exec.disableAutoNewGame(true);
  33. maplist = {[[4612295]],[[4465679]],[[4323335]],[[3544895]],[[646968]],[[3469987]],[[4035194]],[[2816067]],[[3592471]],[[2509175]],[[264132]],[[4271298]],[[210188]],[[211528]],[[3999981]],[[3953425]],[[1856349]],[[3638794]],[[3877599]],[[2894072]],[[3652102]],[[4238784]],[[4148332]],[[3684229]],[[3688419]],[[3008155]],[[3684802]],[[1689382]],[[1019378]],[[3685382]],[[3682405]],[[2796001]],[[1445160]],[[1051384]],[[1051378]],[[645288]],[[470687]],[[419374]],[[465205]],[[664949]],[[369230]],[[277687]],[[704015]],[[398942]],[[271523]],[[1787239]],[[354616]],[[294943]],[[323085]],[[3683600]],[[5045922]],[[5515862]],[[322771]],[[430736]],[[5641251]],[[5472330]],[[2776889]],[[5175753]],[[5028454]],[[517005]],[[3468601]],[[5030579]],[[5029395]],[[4853690]],[[1999967]], [[587458]], [[423062]], [[5422102]], [[5886096]], [[5246345]], [[5583350]], [[184110]], [[5044309]], [[5032745]], [[5339441]], [[2571671]], [[266930]], [[266765]], [[226069]], [[1471124]], [[3575034]], [[1644638]], [[563303]], [[732880]], [[1857829]], [[5833401]], [[410736]], [[400866]], [[679469]], [[5405469]], [[4412890]], [[3211576]], [[175205]], [[5056882]], [[2070768]], [[5349806]], [[452016]], [[3684457]], [[2868414]], [[3690578]], [[2098621]], [[5175727]], [[5717620]], [[4488954]], [[260338]], [[3574927]], [[3575108]], [[3575170]], [[3575216]], [[3575293]], [[3575425]], [[3575463]], [[396347]], [[5588646]], [[3921436]], [[4778991]], [[3746280]], [[3639993]], [[3984750]], [[3994471]], [[5242039]], [[1628732]], [[508796]], [[4734427]], [[1703617]], [[5590554]], [[345290]], [[1661852]], [[4234556]], [[4489653]], [[4468155]], [[349984]], [[4273207]], [[3967250]], [[4091580]], [[327266]], [[1368233]], [[4174320]], [[494706]], [[4174318]], [[229835]], [[407294]], [[3680180]], [[2577060]], [[3579335]], [[3970909]], [[445167]], [[1573213]], [[2854246]], [[1506007]], [[3992276]], [[425797]], [[223293]], [[227417]], [[2840770]], [[667920]], [[571144]], [[556253]], [[260292]], [[261172]], [[3912540]], [[400666]], [[3901403]], [[2813487]], [[354878]], [[563484]], [[537776]], [[538116]], [[289821]], [[1751944]], [[332467]], [[1665516]], [[414899]], [[3604799]], [[1531388]], [[299971]], [[430219]], [[3847244]], [[529844]], [[1692628]], [[1637638]], [[1851411]], [[3685486]], [[313245]], [[292614]], [[266854]], [[232451]], [[511187]], [[193588]], [[2141379]], [[299002]], [[259716]], [[138678]], [[1654841]], [[229834]], [[177236]], [[426638]], [[285752]], [[406266]], [[301315]], [[226879]], [[317696]], [[229944]], [[191201]], [[181312]], [[180469]], [[3696662]], [[3691622]], [[3691609]], [[477603]], [[512927]], [[694900]], [[590641]], [[3683520]], [[195720]], [[260024]], [[1724289]], [[1665249]], [[345257]], [[455167]], [[1787232]], [[314159]], [[344865]], [[613985]], [[201442]], [[180619]], [[3683393]], [[3683383]], [[3683224]], [[156685]], [[408978]], [[3683201]], [[3680223]], [[433937]], [[363625]], [[260384]], [[1693705]], [[319524]], [[209315]], [[252806]], [[3676141]], [[1718723]], [[1564762]], [[1490438]], [[381287]], [[422580]], [[3654416]], [[3644272]], [[3620542]], [[3613029]], [[3611885]], [[3603802]], [[3603799]], [[3595900]], [[3572407]], [[3549840]], [[3548378]], [[3548376]], [[3518418]], [[3517347]], [[3453351]], [[3447108]], [[3444803]], [[3347209]], [[3213562]], [[3209087]], [[3120368]], [[2953315]], [[2928081]], [[2725924]], [[2588032]], [[2393139]], [[2372538]], [[2347666]], [[2223685]], [[2214661]], [[2185089]], [[2174319]], [[2150335]], [[2134537]], [[2118599]], [[2076632]], [[2048474]], [[2005559]], [[1982476]], [[1976007]], [[1965819]], [[1964700]], [[1954898]], [[1841744]], [[1749434]], [[1687268]], [[1716693]], [[1674534]], [[1659639]], [[1657021]]};
  34. doNextMap();
  35.  
  36. tfm.exec.disableAutoShaman(true);
  37. tfm.exec.disableAutoShaman(true);
  38.  
  39. function randomColor()
  40.     return "0x" .. string.format("%X", math.random(0x000000, 0xFFFFFF))
  41. end
  42.  
  43. function eventPlayerLeft(playerName)
  44.     print("<VP>O Player, <J>"..playerName.." <v>saiu da sala.")
  45. end
  46.  
  47. function eventPlayerGetCheese(playerName)
  48.     print("<J>O Player "..playerName.." Pegou o <b>Queijo</b>")
  49. end
  50.  
  51. function eventChatCommand(p,c)
  52.     if c == [[help]] then
  53.         ui.addPopup(0, 0,[[<J><font size='30'color='#46A8F9'>Torneio de racing AC</font><br />Objetivo: Pegar o queijo e chegar até a toca 1° que seus amigos. <font size='20'color='#FFA351'>                   Pontuação: 10 pontos</font> <font size='12'color='#FFFFFF'>O primeiro q fizer 10 pontos vence! Prêmios: 10 Arvores de Natal|| 10 Peles de vamp || Ganhou? Contate-o com o Tectoon!]], p, 200, 100, 500)
  54.     end
  55. end
  56.  
  57. info = {}
  58.  
  59. function eventNewPlayer(p)
  60.     if not info[p] then
  61.         data = {
  62.             ["speed"] = false;
  63.             ["fly"] = false;
  64.             ["teleport"] = false;
  65.             ["time"] = os.time()
  66.         }
  67.         info[p] = data
  68.     end
  69.     tfm.exec.bindKeyboard(p,32,true)
  70.     system.bindMouse(p, true)
  71.     print("<v>O Player, <J>"..p.." <VP>entrou na sala.")
  72. end
  73. function eventPlayerLeft(playerName)
  74.         print("<VP>O Player, <v>"..playerName.." <VP>saiu da sala.")
  75. end
  76.  
  77. function eventPlayerWon(playerName)
  78.         print("<VP>O Player, <v>"..playerName.." <VP>Entrou na toca <b>+1</b>.")
  79. end
  80.  
  81. for p in pairs(tfm.get.room.playerList) do
  82.     eventNewPlayer(p)
  83. end
  84.  
  85. function eventNewGame()
  86.     aliveMice = 0
  87.     for p in pairs(tfm.get.room.playerList) do
  88.         aliveMice = aliveMice+1
  89.     end
  90.     tfm.exec.setUIMapName("<J>"..tfm.get.room.currentMap.."   <G>|   <R>Evento Racing");
  91. end
  92.  
  93. tfm.exec.disableAutoShaman(true)
  94. tfm.exec.disableAutoNewGame(true)
  95. senha="Gameplay"
  96. lock=true
  97. data={}
  98. system.disableChatCommandDisplay("senha")
  99. system.disableChatCommandDisplay("lock")
  100. function eventNewPlayer(name)
  101.     newData={
  102.     ["s"]=10;
  103.     }
  104.     data[name]=newData;
  105.     if lock == true then
  106.         ui.addTextArea(8359,"<font size='48'><font face='Comic Sans MS'><font color='#0000ff'>Este cafofo está protegido por senha. Digite para entrar:",name,000,010,800,400,0x0040ff,0x0040ff,1.0,true)
  107.         ui.addPopup(0,2,"",name,350,175,200,true)
  108.     end
  109. end
  110. for name,player in pairs(tfm.get.room.playerList) do
  111.     eventNewPlayer(name)
  112. end
  113. function eventPlayerDied(name)
  114.     tfm.exec.respawnPlayer(name)
  115. end
  116. function eventChatCommand(name,message)
  117.     if message == "senha" then
  118.         ui.addPopup(1,2,"Insira a nova senha","name",350,175,200,true)
  119.     end
  120.     if message == "lock" then
  121.         if lock == true then
  122.             lock=false
  123.             ui.addPopup(10,0,"A sala foi desbloqueada com sucesso",name,350,175,200,true)
  124.         else
  125.             lock=true
  126.             ui.addPopup(10,0,"A sala foi bloqueada com sucesso, digite !senha para mudar a senha",name,350,175,200,true)
  127.         end
  128.     end
  129. end
  130. function eventPopupAnswer(id,name,answer)
  131.     if id == 0 then
  132.         if senha == answer then
  133.             ui.removeTextArea(8359,name)
  134.             tfm.exec.respawnPlayer(name)
  135.         else
  136.             data[name].s=data[name].s-1
  137.             if data[name].s >= 1 then
  138.                 ui.addPopup(0,2,"Senha incorreta, tente novamente!<br><br>Você ainda pode tentar mais <b>"..data[name].s.." vezes",name,350,175,200,true)
  139.             else
  140.                 ui.addTextArea(8359,"<font size='48'><font face='Comic Sans MS'><font color='#ff0000'>Você errou muitas senhas e não está autorizado a entrar no cafofo.",name,000,010,800,400,0xffff00,0xffff00,1.0,true)
  141.             end
  142.         end
  143.     end
  144.     if id == 1 then
  145.         senha=answer
  146.         ui.addPopup(10,0,"A senha foi mudada para: "..answer.."",name,350,175,200,true)
  147.     end
  148. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement