Advertisement
KananGamer

[Resposta] Lua Evento

Jul 4th, 2017
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.23 KB | None | 0 0
  1. system.disableChatCommandDisplay("lua")
  2. newData={}
  3. function eventNewPlayer(name)
  4.     newData[name]={
  5.         linhas=9
  6.     }
  7. end
  8. for name,player in pairs(tfm.get.room.playerList) do
  9.     eventNewPlayer(name)
  10. end
  11. function lua(name)
  12.     codigo1='event_title = <font color="#C4763E">"Turing Mouse"</font>\n<font color="#B163D8">if</font> <font color="#B163D8">not</font> tfm.get.room.playerList[<font color="#C4763E">"'..name..'"</font>].hasCheese <font color="#B163D8">then</font>\ntfm.exec.giveCheese(<font color="#C4763E">"'..name..'"</font>)\n<font color="#B163D8">end</font>\ntfm.exec.playerVictory(<font color="#C4763E">"'..name..'"</font>)\n<font color="#B163D8">function</font> eventPlayerWon(playerName)\nsystem.giveEventGift(playerName,event_title)\n<font color="#B163D8">end</font>'
  13.     codigo2='event_title = <font color="#C4763E">"Turing Mouse"</font>\n<font color="#B163D8">if</font> tfm.get.room.playerList[<font color="#C4763E">"'..name..'"</font>].hasCheese <font color="#B163D8">then</font>\ntfm.exec.killPlayer(<font color="#C4763E">"'..name..'"</font>)\n<font color="#B163D8">else</font>\ntfm.exec.giveCheese(<font color="#C4763E">"'..name..'"</font>)\n<font color="#B163D8">end</font>\n<font color="#B163D8">function</font> eventPlayerGetCheese(playerName)\nsystem.giveEventGift(playerName,event_title)\n<font color="#B163D8">end</font>'
  14.     codigo3='event_title = <font color="#C4763E">"Turing Mouse"</font>\n<font color="#B163D8">function</font> eventPlayerVampire(playerName)\ntfm.exec.killPlayer(<font color="#C4763E">"'..name..'"</font>)\ntfm.exe.respawnPlayer(<font color="#C4763E">"'..name..'"</font>)\n<font color="#B163D8">end</font>\n<font color="#B163D8">if</font> <font color="#B163D8">not</font> tfm.get.room.playerList[<font color="#C4763E">"'..name..'"</font>].isVampire <font color="#B163D8">then</font>\ntfm.exec.setVampirePlayer(<font color="#C4763E">"'..name..'"</font>)\n<font color="#B163D8">end</font>\n<font color="#B163D8">function</font> eventPlayerRespawn(playerName)\nsystem.giveEventGift(playerName,event_title)\n<font color="#B163D8">end</font>'
  15.     ui.addTextArea(1,"",name,105,45,590,340,0x272834,0x272834,1,true)
  16.     ui.addTextArea(2,"",name,135,50,556,270,0x425B68,0x425B68,1,true)
  17.     ui.addTextArea(3,"",name,136,51,554,268,0x272834,0x272834,1,true)
  18.     ui.addTextArea(4,"<font color='#6C77C0' size='13'>1\n2\n3\n4\n5\n6\n7\n8\n9",name,116,42,0,0,1,1,0,true)
  19.     ui.addTextArea(5,"<font color='#6C77C0' size='13'>10\n11\n12\n13\n14\n15\n16\n17",name,110,185,0,0,1,1,0,true)
  20.     ui.addTextArea(6,"",name,110,364,579,11,0x5D7D90,0x5D7D90,1,true)
  21.     ui.addTextArea(7,"",name,110,366,581,11,0x11171C,0x11171C,1,true)
  22.     ui.addTextArea(8,"",name,110,365,580,11,0x3C5064,0x3C5064,1,true)
  23.     ui.addTextArea(9,"<p align='center'><b><font size='11'><a href='event:fechar'>Fechar                                                                               ",name,110,361,580,0,0x3C5064,0x3C5064,0,true)
  24.     ui.addTextArea(10,"",name,110,339,579,11,0x5D7D90,0x5D7D90,1,true)
  25.     ui.addTextArea(11,"",name,110,341,581,11,0x11171C,0x11171C,1,true)
  26.     ui.addTextArea(12,"",name,110,340,580,11,0x3C5064,0x3C5064,1,true)
  27.     ui.addTextArea(13,"<p align='center'><b><font size='11'><a href='event:enviar'>Enviar                                                                               ",name,110,337,580,0,0x3C5064,0x3C5064,0,true)
  28.     ui.addTextArea(14,'<font size="13">'..codigo2,name,131,43,552,266,1,1,0,true)
  29.     ui.addTextArea(15,"<font size='14'><a href='event:menospag'>←</a> "..newData[name].linhas.." Linhas <a href='event:maispag'>→</a>",name,580,300,0,0,1,1,0,true)
  30. end
  31. function eventTextAreaCallback(id,playerName,link)
  32.  
  33.     if link == "fechar" then
  34.         for i = 1,15 do
  35.             ui.removeTextArea(i,playerName)
  36.         end
  37.         newData[playerName].linhas = 9
  38.     end
  39.     if link == "maispag" then
  40.         if newData[playerName].linhas == 9 then
  41.             newData[playerName].linhas = 11
  42.             ui.addTextArea(14,'<font size="13">'..codigo3,playerName,131,43,552,266,1,1,0,true)
  43.             ui.addTextArea(15,"<font size='14'><a href='event:menospag'>←</a> "..newData[playerName].linhas.." Linhas <a href='event:maispag'>→</a>",playerName,580,300,0,0,1,1,0,true)
  44.         end
  45.         if newData[playerName].linhas == 8 then
  46.             newData[playerName].linhas = 9
  47.             ui.addTextArea(14,'<font size="13">'..codigo2,playerName,131,43,552,266,1,1,0,true)
  48.             ui.addTextArea(15,"<font size='14'><a href='event:menospag'>←</a> "..newData[playerName].linhas.." Linhas <a href='event:maispag'>→</a>",playerName,580,300,0,0,1,1,0,true)
  49.         end
  50.     end
  51.     if link == "menospag" then
  52.         if newData[playerName].linhas == 9 then
  53.             newData[playerName].linhas = 8
  54.             ui.addTextArea(14,'<font size="13">'..codigo1,playerName,131,43,552,266,1,1,0,true)
  55.             ui.addTextArea(15,"<font size='14'><a href='event:menospag'>←</a> "..newData[playerName].linhas.." Linhas <a href='event:maispag'>→</a>",playerName,580,300,0,0,1,1,0,true)
  56.         end
  57.         if newData[playerName].linhas == 11 then
  58.             newData[playerName].linhas = 9
  59.             ui.addTextArea(14,'<font size="13">'..codigo2,playerName,131,43,552,266,1,1,0,true)
  60.             ui.addTextArea(15,"<font size='14'><a href='event:menospag'>←</a> "..newData[playerName].linhas.." Linhas <a href='event:maispag'>→</a>",playerName,580,300,0,0,1,1,0,true)
  61.         end
  62.     end
  63. end
  64. function eventChatCommand(name,command)
  65.     if command == "lua" then
  66.         lua(name)
  67.     end
  68. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement