Advertisement
Tectoon

[TFM] Senha para Cafofo (SystemLock)

Apr 29th, 2015
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.58 KB | None | 0 0
  1. tfm.exec.disableAutoShaman(true)
  2. tfm.exec.disableAutoNewGame(true)
  3. senha="Gameplay"
  4. lock=true
  5. data={}
  6. tfm.exec.newGame('<C><P D="x_nekodancer/x_mondes/x_11.jpg" /><Z><S><S P="0,0,0.3,0.2,0,0,0,0" L="797" o="697395" X="401" Y="405" T="12" H="12" /><S P="0,0,0.3,0.2,0,0,0,0" L="800" o="ffb062" X="400" Y="112" T="12" H="10" /><S L="800" o="ffb062" X="400" H="10" Y="6" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="10" o="697395" X="806" Y="200" T="12" H="400" /><S L="10" o="697395" X="-5" H="400" Y="200" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S L="800" o="ffb062" X="400" H="10" Y="14" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="801" o="697395" H="101" Y="-51" T="12" X="401" /></S><D><P C="ffad00,ffb062" Y="-290" T="117" X="1" P="0,0" /><DC Y="87" X="404" /><P C="fdfdfd" Y="238" T="90" P="0,0" X="696" /></D><O /></Z></C>')
  7. system.disableChatCommandDisplay("senha")
  8. system.disableChatCommandDisplay("lock")
  9. function eventNewPlayer(name)
  10.     newData={
  11.     ["s"]=10;
  12.     }
  13.     data[name]=newData;
  14.     if lock == true then
  15.         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)
  16.         ui.addPopup(0,2,"",name,350,175,200,true)
  17.     end
  18. end
  19. for name,player in pairs(tfm.get.room.playerList) do
  20.     eventNewPlayer(name)
  21. end
  22. function eventPlayerDied(name)
  23.     tfm.exec.respawnPlayer(name)
  24. end
  25. function eventChatCommand(name,message)
  26.     if message == "senha" then
  27.         ui.addPopup(1,2,"Insira a nova senha","name",350,175,200,true)
  28.     end
  29.     if message == "lock" then
  30.         if lock == true then
  31.             lock=false
  32.             ui.addPopup(10,0,"A sala foi desbloqueada com sucesso",name,350,175,200,true)
  33.         else
  34.             lock=true
  35.             ui.addPopup(10,0,"A sala foi bloqueada com sucesso, digite !senha para mudar a senha",name,350,175,200,true)
  36.         end
  37.     end
  38. end
  39. function eventPopupAnswer(id,name,answer)
  40.     if id == 0 then
  41.         if senha == answer then
  42.             ui.removeTextArea(8359,name)
  43.             tfm.exec.respawnPlayer(name)
  44.         else
  45.             data[name].s=data[name].s-1
  46.             if data[name].s >= 1 then
  47.                 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)
  48.             else
  49.                 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)
  50.             end
  51.         end
  52.     end
  53.     if id == 1 then
  54.         senha=answer
  55.         ui.addPopup(10,0,"A senha foi mudada para: "..answer.."",name,350,175,200,true)
  56.     end
  57. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement