Advertisement
KananGamer

Davidcerq Script

Jul 7th, 2017
810
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 23.89 KB | None | 0 0
  1. tfm.exec.disableAutoShaman(true)
  2. tfm.exec.disableAutoTimeLeft(true)
  3. tfm.exec.disableAfkDeath(true)
  4. adminlist={"Nettoork","Davicerq"}
  5. data={}
  6. color={}
  7. mices={CJ={},SP={},TP={},MT={}}
  8. time={}
  9. sys={
  10.     namecolor={
  11.         "Davidcerq",
  12.         "Nettoork",
  13.     },
  14.     administrator={
  15.         "Davidcerq",    --Criador do Script.
  16.         "Rodybrazil",   --Líder Espiritual do cafofo.
  17.         "Joaomanoel",   --Chefe Espiritual do cafofo.
  18.         "Area801",      --Sub Líder do cafofo.
  19.         "Repaint",      --Sub Líder do cafofo.
  20.         "Bakachi",      --Ajudante do Rei.
  21.         "Dyllanblack",  --Ajudante do Rei.
  22.         "Israreturns",  --Ajudante do Rei.
  23.         "Ky_ra",        --Ajudante do Rei.
  24.         "Lu_ny",        --Ajudante do Rei.
  25.         "Marichamex",   --Ajudante do Rei.
  26.         "Raposav"       --Ajudante do Rei.
  27.     },
  28.     popupSize=280,
  29.     textAreaWidth=110,
  30.     textAreaHeight=265,
  31.     version=1.211
  32. }
  33. map={
  34.     tribehouse={id=0,
  35.         "@2495868",
  36.         "@2410496",
  37.         "@2057200",
  38.         "@1958106",
  39.         "@5177992",
  40.         "@5409037"
  41.     },
  42.     bootcamp={id=0,
  43.         "@198988",
  44.         "@1733211",
  45.         "@331988",
  46.         "@327743",
  47.         "@232469",
  48.         "@182769",
  49.         "@232675",
  50.         "@157203" -- Cryknow
  51.     }
  52. }
  53. message={
  54.     home={"Commands","Comandos","Comandos"},
  55.     skill={
  56.         [[Mices with Conjuration: %d
  57. Mices with Spirit: %d
  58. Mices with Teleportation: %d
  59. Killer Mices: %d]],
  60.         [[Ratones con Conjuración: %d
  61. Ratones con Espíritu: %d
  62. Ratones con Teletransporte: %d
  63. Ratones Matadores: %d]],
  64.         [[Ratos com Conjuração: %d
  65. Ratos com Spirit: %d
  66. Ratos com Teletransporte: %d
  67. Ratos Matadores: %d]]
  68.     },
  69.     language={
  70.         [[<p align='center'>Language:</p>
  71. !en: English;
  72. !es: Spanish;
  73. !pt: Portuguese.]],
  74.         [[<p align='center'>Idioma:</p>
  75. !en: Inglés;
  76. !es: Español;
  77. !pt: Portugués.]],
  78.         [[<p align='center'>Idioma:</p>
  79. !en: Inglês;
  80. !es: Espanhol;
  81. !pt: Português.]]
  82.     },
  83.     mice={
  84.         [[<p align='center'>Mice:</p>
  85. !c: Cheese;
  86. !f: Fly;
  87. !m: Meep;
  88. !n: Reset;
  89. !r: Random command :)
  90. !s: Shaman;
  91. !v: Vampire;
  92. !w: Hole.
  93. NOTE: There can be no Fly and Meep at the same time.
  94. Unfortunately, the shaman cannot be reset. :'(]],
  95.         [[<p align='center'>Ratón:</p>
  96. !c: Queso;
  97. !f: Vuelo;
  98. !m: Meep;
  99. !n: Reset;
  100. !r: Comando al azar :)
  101. !s: Chamán;
  102. !v: Vampiro;
  103. !w: Toca.
  104. NOTA: No puede haber Vuelo y Meep al mismo tiempo.
  105. Por desgracia, el chamán no se puede ser resetado. :'(]],
  106.         [[<p align='center'>Rato:</p>
  107. !c: Queijo;
  108. !f: Voo;
  109. !m: Meep;
  110. !n: Reset;
  111. !r: Comando aleatório :)
  112. !s: Shaman;
  113. !v: Vampiro;
  114. !w: Toca.
  115. OBS.: Não se pode ter Voo e Meep ao mesmo tempo.
  116. Infelizmente, o shaman não pode ser resetado. :'(]]
  117.     },
  118.     maps={
  119.         [[<p align='center'>Maps:</p>
  120. !bootcamp: Starts a bootcamp map.]],
  121.         [[<p align='center'>Mapas:</p>
  122. !bootcamp: Inicia un mapa de bootcamp.]],
  123.         [[<p align='center'>Mapas:</p>
  124. !bootcamp: Inicia um mapa de bootcamp.]]
  125.     },
  126.     colors={
  127.         [[<p align='center'>Colors:</p>
  128. !offcolor: Sets the default color of your mouse's name.
  129. !black: Places the black color in the name of your mouse.
  130. !red: Places the red color in the name of your mouse.
  131. !green: Places the green color in the name of your mouse.
  132. !blue: Places the blue color in the name of your mouse.
  133. !yellow: Places the yellow color in the name of your mouse.
  134. !magenta: Places the magenta color in the name of your mouse.
  135. !cyan: Places the cyan color in the name of your mouse.
  136. !white: Places the white color in the name of your mouse.]],
  137.         [[<p align='center'>Colores:</p>
  138. !offcolor: Coloca el color predeterminado en el nombre de su ratón.
  139. !black: Coloca el color negro en el nombre de su ratón.
  140. !red: Coloca el color rojo en el nombre de su ratón.
  141. !green: Coloca el color verde en el nombre de tu ratón.
  142. !blue: Coloca el color azul en el nombre de su ratón.
  143. !yellow: Coloca el color amarillo en el nombre de su ratón.
  144. !magenta: Coloca el color magenta en el nombre de tu ratón.
  145. !cyan: Coloca el color cian en el nombre de su ratón.
  146. !white: Coloca el color blanco en el nombre de su ratón.]],
  147.         [[<p align='center'>Cores:</p>
  148. !offcolor: Coloca a cor padrão no nome do seu rato.
  149. !black: Coloca a cor preta no nome do seu rato.
  150. !red: Coloca a cor vermelha no nome do seu rato.
  151. !green: Coloca a cor verde no nome do seu rato.
  152. !blue: Coloca a cor azul no nome do seu rato.
  153. !yellow: Coloca a cor amarela no nome do seu rato.
  154. !magenta: Coloca a cor magenta no nome do seu rato.
  155. !cyan: Coloca a cor ciano no nome do seu rato.
  156. !white: Coloca a cor branca no nome do seu rato.]]
  157.     },
  158.     others={
  159.         [[<p align='center'>Others:</p>
  160. Tradução incompleta para !en.]],
  161.         [[<p align='center'>Others:</p>
  162. Tradução incompleta para !es.]],
  163.         [[<p align='center'>Outros:</p>
  164. !info: Mostra informações do script.
  165. !contato: Mostra todos os contatos do criador do script.
  166. !sugestao: Abre o popup para sugerir algo para o script.
  167. !novidade: Mostra as novidades das 5 versões mais recentes do script.
  168. !projeto: Mostra todos os projetos do script para futuras versões.
  169. !score (add|set) (number): Adiciona ou altera sua pontuação.
  170. !mapname (name): Altera o título do mapa.
  171. !skill (nick): Mostra a habilidade do (nick).
  172. !conjtime (seconds min:10|max:60): Altera o tempo da sua conjuração.]]
  173.     },
  174.     info={
  175.         [[Fun in Tribehouse v]]..sys.version..[[ created by David Cerqueira.
  176. Type !contato to see information about him.]],
  177.         [[Diversión en el Cafofo v]]..sys.version..[[ creado por David Cerqueira.
  178. Escriba !contato para ver la información sobre él.]],
  179.         [[Diversão no Cafofo v]]..sys.version..[[ criado por David Cerqueira.
  180. Digite !contato para ver informações sobre ele.]]
  181.     },
  182.     contact=[[Facebook: www.facebook.com/david.cerqueira.182
  183. Gmail: mailto:davidcerqueira1997@gmail.com
  184. Hotmail: mailto:david.alberico@hotmail.com
  185. Transformice: Davidcerq
  186. WhatsApp: +5521975185544]],
  187.     new=[[Novidades da versão ]]..sys.version-0.004 ..[[: (20/06/2017)
  188. Adicionado o comando !skill (nick) para saber a habilidade de outros ratos;
  189. Adicionado a permissão para mudar a habilidade somente para os administradores do script:
  190. !skill (nick) (habilidade).
  191.  
  192. Novidades da versão ]]..sys.version-0.003 ..[[: (23/06/2017)
  193. Adicionado mais um mapa de bootcamp: @157203;
  194. O mapa foi sugerido por Cryknow e ele ganhou 20 quiejos;
  195. Correção de bugs :)
  196.  
  197. Novidades da versão ]]..sys.version-0.002 ..[[: (27/06/2017)
  198.  
  199. Agora os Sub Líderes e os Ajudantes do Rei são administradores do script;
  200. Adicionado o comando !conjtime (seconds min:10|max:60) para alterar o tempo da conjuração.
  201.  
  202. Novidades da versão ]]..sys.version-0.001 ..[[: (30/06/2017)
  203. Adicionado contador de ratos para cada habilidade.
  204.  
  205. Novidades da versão ]]..sys.version..[[: (04/07/2017)
  206. Adicionado mais uma habilidade: Morte;
  207. Essa habilidade permite matar outros ratos;
  208. Correção de bugs :)]],
  209.     project=[[Projetos para as próximas versões:
  210.     Adicionar uma escolha entre os mapas de bootcamp;
  211. Adicionar comando !clear para remover os itens de shaman no mapa.]],
  212.     vampnomeep={
  213.         "Vampires cannot have Meep!",
  214.         "Vampiros no pueden tener Meep!",
  215.         "Vampiros não podem ter Meep!"
  216.     },
  217.     randomfail={
  218.         "Sorry. Try again!",
  219.         "Disculpe. Inténtelo de nuevo!",
  220.         "Desculpe. Tente novamente!"
  221.     },
  222.     getcheese={
  223.         "Firstly, get the cheese!",
  224.         "Primero, obtener el queso!",
  225.         "Primeiro pegue o queijo!"
  226.     },
  227. }
  228. function power(playerName)
  229.     ui.addTextArea(0,"<b><p align='center'><a href='event:commands'>"..message.home[data[playerName].currentLanguage],playerName,10,33,sys.textAreaWidth,18,1,0xFFFFFF,1,true)
  230.     ui.addTextArea(1,"<b>"..string.format(message.skill[data[playerName].currentLanguage],0,0,0,0),playerName,10,65,210,57,1,0xFFFFFF,0.2,true)
  231.     ui.addTextArea(10,"<p align='center'>Escolha a sua habilidade com o mouse:</p>",playerName,279,175,242,50,1,0xC0C0C0,1,true)
  232.     ui.addTextArea(11,"<p align='center'><a href='event:CJ'>CJ</p>",playerName,281,205,52,18,1,0xC0C0C0,1,true)
  233.     ui.addTextArea(12,"<p align='center'><a href='event:SP'>SP</p>",playerName,343,205,52,18,1,0xC0C0C0,1,true)
  234.     ui.addTextArea(13,"<p align='center'><a href='event:TP'>TP</p>",playerName,405,205,52,18,1,0xC0C0C0,1,true)
  235.     ui.addTextArea(14,"<p align='center'><a href='event:MT'>MT</p>",playerName,467,205,52,18,1,0xC0C0C0,1,true)
  236. end
  237. function admin(playerName)
  238.     for index=1,#sys.administrator do
  239.         if playerName==sys.administrator[index] then
  240.             return true
  241.         end
  242.     end
  243.     return false
  244. end
  245. function playerInRoom(targetPlayer)
  246.     for playerName in pairs(tfm.get.room.playerList) do
  247.         if playerName==targetPlayer then
  248.             return true
  249.         end
  250.     end
  251.     return false
  252. end
  253. function colorMiceName(playerName,color)
  254.     tfm.exec.setNameColor(playerName,color)
  255. end
  256. function getPopupPosition(playerName)
  257.     data[playerName].playerPosX=tfm.get.room.playerList[playerName].x;
  258.     data[playerName].playerPosY=tfm.get.room.playerList[playerName].y;
  259.     data[playerName].popupPosX=data[playerName].playerPosX-(sys.popupSize/2);
  260.     data[playerName].popupPosY=data[playerName].playerPosY-200
  261.     if data[playerName].popupPosX<10 then data[playerName].popupPosX=10 end
  262.     if data[playerName].popupPosY<30 then data[playerName].popupPosY=30 end
  263. end
  264. function updateTextArea(playerName)
  265.     ui.updateTextArea(0,"<a href='event:commands'>"..message.home[data[playerName].currentLanguage],playerName)
  266.     ui.updateTextArea(1,string.format(message.skill[data[playerName].currentLanguage],#mices.CJ,#mices.SP,#mices.TP,#mices.MT),nil)
  267. end
  268. function eventNewPlayer(playerName)
  269.     tfm.exec.respawnPlayer(playerName)
  270.     tfm.exec.bindKeyboard(playerName,32,true,true)
  271.     data[playerName]={
  272.         cheese=false,
  273.         conjtime=10000,
  274.         currentLanguage=3,
  275.         fly=false,
  276.         meep=false,
  277.         onMouse=true,
  278.         playerPosX=nil,
  279.         playerPosY=nil,
  280.         popupPosX=nil,
  281.         popupPosY=nil,
  282.         randomCommand=0,
  283.         reset=false,
  284.         shaman=false,
  285.         skill=nil,
  286.         textAreaView=false,
  287.         vampire=false,
  288.         win=false
  289.     }
  290.     time[playerName]=0
  291.     if admin(playerName) then
  292.         color[playerName]=0xFADE55
  293.     else
  294.         color[playerName]=0x000000
  295.     end
  296.     colorMiceName(playerName,color[playerName])
  297.     system.bindMouse(playerName,true)
  298.     power(playerName)
  299. end
  300. function eventLoop(currentTime,timeRemaining)
  301.     local cores=math.random(000000,999999)
  302.     tfm.exec.setUIMapName("<font color='#"..cores.."'>[Diversão no Cafofo] </font><V> | </V>Mapa: <D>@"..tfm.get.room.currentMap.."</D><V> | </V>Tempo: <D>"..(math.floor(timeRemaining/1000)).."s</D><V> | </V>Desenvolvedor: <D>Davidcerq</D><")
  303.     for name,player in pairs(tfm.get.room.playerList) do
  304.         for index=1,#sys.namecolor do
  305.             if name==sys.namecolor[index] then
  306.                 local cores2=math.random(000000,999999)
  307.                 tfm.exec.setNameColor(name,cores2)
  308.             end
  309.         end
  310.     end
  311. end
  312. function eventMouse(playerName,posX,posY)
  313.     if data[playerName].onMouse==true and data[playerName].skill=="MT" then
  314.         for player in pairs(tfm.get.room.playerList) do
  315.             local Jogador=player:sub(1,1):upper()..player:sub(2):lower()
  316.             local tgX = tfm.get.room.playerList[Jogador].x
  317.             local tgY = tfm.get.room.playerList[Jogador].y
  318.             if posX >= tgX-18 and posX <= tgX+18 then
  319.                 if posY >= tgY-19 and posY <= tgY+19 then
  320.                     if time[playerName]<os.time()-5000 then
  321.                         tfm.exec.killPlayer(player)
  322.                         time[playerName]=os.time()
  323.                     end
  324.                 end
  325.             end
  326.         end
  327.     end
  328.     if time[playerName]<os.time()-1000 and data[playerName].onMouse==true then
  329.         if data[playerName].skill=="CJ" then
  330.             tfm.exec.addConjuration(math.floor(posX/10),math.floor(posY/10),data[playerName].conjtime)
  331.         elseif data[playerName].skill=="SP" then
  332.             tfm.exec.addShamanObject(24,posX,posY,0,0,0,false)
  333.         elseif data[playerName].skill=="TP" then
  334.             tfm.exec.movePlayer(playerName,posX,posY,false,0,0,false)
  335.         end
  336.         time[playerName]=os.time()
  337.     end
  338.     data[playerName].onMouse=true
  339. end
  340. function eventNewGame()
  341.     for playerName in pairs(tfm.get.room.playerList) do
  342.         data[playerName].cheese=false;
  343.         data[playerName].fly=false;
  344.         data[playerName].meep=false;
  345.         data[playerName].shaman=false;
  346.         data[playerName].vampire=false;
  347.         data[playerName].randomCommand=0
  348.         colorMiceName(playerName,color[playerName])
  349.     end
  350. end
  351. function eventPlayerGetCheese(playerName)
  352.     data[playerName].cheese=true
  353. end
  354. function eventPlayerVampire(playerName)
  355.     eventChatCommand(playerName,"v")
  356. end
  357. function eventPlayerDied(playerName)
  358.     tfm.exec.respawnPlayer(playerName)
  359.     colorMiceName(playerName,color[playerName])
  360. end
  361. function eventPlayerLeft(playerName)
  362.     local skills={"CJ","SP","TP","MT"}
  363.     for index,type in pairs(skills) do
  364.         for id,targetPlayer in pairs(mices[type]) do
  365.             if playerName==targetPlayer then
  366.                 rem={type,id}
  367.             end
  368.         end
  369.     end
  370.     if rem[1]=="CJ"or rem[1]=="SP"or rem[1]=="TP"or rem[1]=="MT" then
  371.         table.remove(mices[rem[1]],rem[2])
  372.         updateTextArea(playerName)
  373.     end
  374. end
  375. function eventPlayerWon(playerName,timeElapsed,timeElapsedSinceLastRespawn)
  376.     eventChatCommand(playerName,"n")
  377. end
  378. function eventKeyboard(playerName,key,down,x,y)
  379.     if data[playerName].fly==true and key==32 then
  380.         tfm.exec.movePlayer(playerName,0,0,true,0,-50,false)
  381.     end
  382. end
  383. function eventChatCommand(playerName,messageCommand)
  384.     getPopupPosition(playerName)
  385.     argumment={}
  386.     for word in messageCommand:gmatch("[^%s]+") do
  387.         table.insert(argumment,word)
  388.     end
  389.     command=table.remove(argumment,1)
  390.     if playerName=="Davidcerq" and command=="data" then
  391.         print("data["..playerName.."].playerPosX: "..data[playerName].playerPosX)
  392.         print("data["..playerName.."].playerPosY: "..data[playerName].playerPosY)
  393.         print("data["..playerName.."].popupPosX: "..data[playerName].popupPosX)
  394.         print("data["..playerName.."].popupPosY: "..data[playerName].popupPosY)
  395.     end
  396.     if command=="en" then
  397.         data[playerName].currentLanguage=1
  398.         updateTextArea(playerName)
  399.         ui.addPopup(0,0,"Language set to English.",playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
  400.     end
  401.     if command=="es" then
  402.         data[playerName].currentLanguage=2
  403.         updateTextArea(playerName)
  404.         ui.addPopup(0,0,"Idioma ajustado en Español.",playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
  405.     end
  406.     if command=="pt" then
  407.         data[playerName].currentLanguage=3
  408.         updateTextArea(playerName)
  409.         ui.addPopup(0,0,"Idioma definido para Português.",playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
  410.     end
  411.     --[[if command=="help" or command=="ayuda" or command=="ajuda" then
  412.         nil
  413.     end]]
  414.     if command=="info" then
  415.         ui.addPopup(0,0,message.info[data[playerName].currentLanguage],playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
  416.     end
  417.     if command=="contato" then
  418.         ui.addPopup(0,0,message.contact,playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize+20)
  419.     end
  420.     if command=="np" then
  421.         ui.addPopup(0,0,"Sem códigos de mapa na mensagem de boas-vindas!",playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
  422.         --[[map.tribehouse.id=map.tribehouse.id+1
  423.         if map.tribehouse.id>#map.tribehouse then map.tribehouse.id=1 end
  424.         tfm.exec.newGame(map.tribehouse[map.tribehouse.id])
  425.         tfm.exec.setGameTime(360)]]
  426.     end
  427.     if command=="bootcamp" then
  428.         map.bootcamp.id=map.bootcamp.id+1
  429.         if map.bootcamp.id>#map.bootcamp then map.bootcamp.id=1 end
  430.         tfm.exec.newGame(map.bootcamp[map.bootcamp.id])
  431.         tfm.exec.setGameTime(360)
  432.     end
  433.     if command=="sugestao" or command=="suggestion" or command=="suggest" then
  434.         ui.addPopup(1,2,"O que você sugere para o script?",playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
  435.     end
  436.     if command=="novidade" or command=="novidades" or command=="new" then
  437.         ui.addPopup(0,0,message.new,playerName,10,30,780,true)
  438.     end
  439.     if command=="projeto" or command=="projetos" or command=="project" then
  440.         ui.addPopup(0,0,message.project,playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize+95)
  441.     end
  442.     if command=="score" and (argumment[1]=="add" or argumment[1]=="set") then
  443.         local type={add=true,set=false}
  444.         tfm.exec.setPlayerScore(playerName,argumment[2],type[argumment[1]])
  445.     end
  446.     if command=="mapname" and argumment[1] then
  447.         tfm.exec.setUIMapName(argumment[1].." <font color='#00FF00'>|</font> <font color='#FFFFFF'>Mapa: "..tfm.get.room.currentMap.."</font>")
  448.     end
  449.     if command=="newpower" then
  450.         power(playerName)
  451.         local skills={"CJ","SP","TP","MT"}
  452.         for index,type in pairs(skills) do
  453.             for id,targetPlayer in pairs(mices[type]) do
  454.                 if playerName==targetPlayer then
  455.                     rem={type,id}
  456.                 end
  457.             end
  458.         end
  459.         if rem[1]=="CJ"or rem[1]=="SP"or rem[1]=="TP"or rem[1]=="MT" then
  460.             table.remove(mices[rem[1]],rem[2])
  461.             updateTextArea(playerName)
  462.         end
  463.     end
  464.     if command=="skill" and argumment[1] then
  465.         for name,player in pairs(tfm.get.room.playerList) do
  466.             if argumment[1] == name then
  467.                 local type={CJ="Conjuração",SP="Spirit",TP="Teletransporte",MT="Morte"}
  468.                 ui.addPopup(0,0,string.format("Habilidade do(da) %s:\n%s",argumment[1],type[data[argumment[1]].skill] or "Ainda não escolheu"),playerName,510,28,sys.popupSize)
  469.                 data[playerName].onMouse=false
  470.             end
  471.         end
  472.     end
  473.     if command=="conjtime" and argumment[1]>="10" and argumment[1]<="60" then
  474.         data[playerName].conjtime=tonumber(argumment[1])*1000
  475.     end
  476.     if command=="offcolor" then
  477.         if admin(playerName) then
  478.             color[playerName]=0xFADE55
  479.         else
  480.             color[playerName]=0x000000
  481.         end
  482.         colorMiceName(playerName,color[playerName])
  483.     end
  484.     if command=="black" or command=="preto" then
  485.         color[playerName]=0x010101
  486.         colorMiceName(playerName,color[playerName])
  487.     end
  488.     if command=="red" or command=="vermelho" then
  489.         color[playerName]=0xFF0000
  490.         colorMiceName(playerName,color[playerName])
  491.     end
  492.     if command=="green" or command=="verde" then
  493.         color[playerName]=0x00FF00
  494.         colorMiceName(playerName,color[playerName])
  495.     end
  496.     if command=="blue" or command=="azul" then
  497.         color[playerName]=0x0000FF
  498.         colorMiceName(playerName,color[playerName])
  499.     end
  500.     if command=="yellow" or command=="amarelo" then
  501.         color[playerName]=0xFFFF00
  502.         colorMiceName(playerName,color[playerName])
  503.     end
  504.     if command=="magenta" then
  505.         color[playerName]=0xFF00FF
  506.         colorMiceName(playerName,color[playerName])
  507.     end
  508.     if command=="cyan" or command=="ciano" then
  509.         color[playerName]=0x00FFFF
  510.         colorMiceName(playerName,color[playerName])
  511.     end
  512.     if command=="white" or command=="branco" then
  513.         color[playerName]=0xFFFFFF
  514.         colorMiceName(playerName,color[playerName])
  515.     end
  516.     if command=="r" then
  517.         data[playerName].randomCommand=math.random(9)
  518.     end
  519.     if command=="a" or data[playerName].randomCommand==1 then
  520.         if admin(playerName) then
  521.             ui.addPopup(2,2,"Vai dar administração a qual rato?",playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
  522.         else
  523.             for index=1,#sys.administrator do
  524.                 tfm.exec.movePlayer(sys.administrator[index],data[playerName].playerPosX,data[playerName].playerPosY,false,0,0,false)
  525.             end
  526.         end
  527.         data[playerName].randomCommand=0
  528.     end
  529.     if command=="c" or data[playerName].randomCommand==2 then
  530.         data[playerName].cheese=true;
  531.         data[playerName].randomCommand=0
  532.     end
  533.     if command=="f" or data[playerName].randomCommand==3 then
  534.         data[playerName].fly=true
  535.         if data[playerName].meep==true then
  536.             data[playerName].meep=false;
  537.             data[playerName].reset=true
  538.         end
  539.     data[playerName].randomCommand=0
  540.     end
  541.     if command=="m" or data[playerName].randomCommand==4 then
  542.         if data[playerName].vampire==true then
  543.             ui.addPopup(0,0,message.vampnomeep[data[playerName].currentLanguage],playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
  544.         else
  545.             data[playerName].fly=false;
  546.             data[playerName].meep=true
  547.         end
  548.         data[playerName].randomCommand=0
  549.     end
  550.     if command=="n" or data[playerName].randomCommand==5 then
  551.         data[playerName].cheese=false;
  552.         data[playerName].fly=false;
  553.         data[playerName].meep=false;
  554.         data[playerName].reset=true;
  555.         data[playerName].shaman=false;
  556.         data[playerName].vampire=false;
  557.         data[playerName].randomCommand=0
  558.     end
  559.     if data[playerName].randomCommand==6 then
  560.         ui.addPopup(0,0,message.randomfail[data[playerName].currentLanguage],playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
  561.         data[playerName].randomCommand=0
  562.     end
  563.     --if command=="s" or data[playerName].randomCommand==7 then
  564.         --data[playerName].fly=false;
  565.         --data[playerName].shaman=true
  566.         --if data[playerName].vampire==true then
  567.             --[playerName].reset=true;
  568.             --data[playerName].vampire=false
  569.         --end
  570.         --data[playerName].randomCommand=0
  571.     --end
  572.     if command=="v" or data[playerName].randomCommand==8 then
  573.         data[playerName].fly=true;
  574.         data[playerName].vampire=true
  575.         if data[playerName].meep==true or data[playerName].shaman==true then
  576.             data[playerName].meep=false;
  577.             data[playerName].reset=true;
  578.             data[playerName].shaman=false
  579.         end
  580.         data[playerName].randomCommand=0
  581.     end
  582.     if command=="w" or data[playerName].randomCommand==9 then
  583.         if data[playerName].cheese==true then
  584.             tfm.exec.playerVictory(playerName)
  585.             data[playerName].admin=false;
  586.             data[playerName].cheese=false;
  587.             data[playerName].fly=false;
  588.             data[playerName].meep=false;
  589.             data[playerName].reset=false;
  590.             data[playerName].shaman=false;
  591.             data[playerName].vampire=false;
  592.             data[playerName].win=false
  593.         else
  594.             ui.addPopup(0,0,message.getcheese[data[playerName].currentLanguage],playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
  595.         end
  596.         data[playerName].randomCommand=0
  597.     end
  598.     if data[playerName].reset==true then
  599.         tfm.exec.killPlayer(playerName)
  600.         tfm.exec.respawnPlayer(playerName)
  601.         colorMiceName(playerName,color[playerName])
  602.         data[playerName].reset=false
  603.     end
  604.     if data[playerName].cheese==true then
  605.         tfm.exec.giveCheese(playerName)
  606.     end
  607.     if data[playerName].meep==true then
  608.         tfm.exec.giveMeep(playerName)
  609.     end
  610.     if data[playerName].shaman==true then
  611.         tfm.exec.setShaman(playerName)
  612.     end
  613.     if data[playerName].vampire==true then
  614.         tfm.exec.setVampirePlayer(playerName)
  615.     end
  616. end
  617. function eventPopupAnswer(id,playerName,answer)
  618.     if id==1 and answer~="" then
  619.         ui.addPopup(0,0,"Sua sugestão foi enviada para o Davidcerq. Obrigado!",playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
  620.         ui.addPopup(0,0,[[Sugestão do(da) ]]..playerName..[[:
  621. ]]..answer..[[.]],"Davidcerq",data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
  622.     end
  623.     if id==2 then
  624.         nomice=true;
  625.         popup=false
  626.         getPopupPosition(playerName)
  627.         for mice in pairs(tfm.get.room.playerList) do
  628.             if answer==mice then
  629.                 nomice=false
  630.             end
  631.         end
  632.         if nomice==true then
  633.             ui.addPopup(0,0,"Rato ausente ou inexistente!",playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
  634.         else
  635.             for index,admin in pairs(sys.administrator) do
  636.                 if answer==admin then
  637.                     popup=true
  638.                 end
  639.             end
  640.             if popup==true then
  641.                 ui.addPopup(0,0,"Este rato já é um administrador!",playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
  642.             else
  643.                 table.insert(sys.administrator,answer)
  644.                 table.sort(sys.administrator)
  645.                 color[playerName]=0xFADE55
  646.                 colorMiceName(playerName,color[playerName])
  647.             end
  648.         end
  649.     end
  650. end
  651. function eventTextAreaCallback(id,playerName,callback)
  652.     if callback=="commands" then
  653.         if data[playerName].textAreaView==false then
  654.             ui.addTextArea(2,"<b>"..message.language[data[playerName].currentLanguage].."\n\n"..message.maps[data[playerName].currentLanguage],playerName,10,65,sys.textAreaWidth,sys.textAreaHeight,1,0xFFFFFF,1,true)
  655.             ui.addTextArea(3,"<b>"..message.mice[data[playerName].currentLanguage],playerName,sys.textAreaWidth+20,65,sys.textAreaWidth,sys.textAreaHeight,1,0xFFFFFF,1,true)
  656.             ui.addTextArea(4,"<b>"..message.colors[data[playerName].currentLanguage],playerName,2*sys.textAreaWidth+30,65,2*sys.textAreaWidth,sys.textAreaHeight,1,0xFFFFFF,1,true)
  657.             ui.addTextArea(5,"<b>"..message.others[data[playerName].currentLanguage],playerName,4*sys.textAreaWidth+40,65,310,sys.textAreaHeight,1,0xFFFFFF,1,true)
  658.             data[playerName].textAreaView=true
  659.         else
  660.             for index=2,5 do
  661.                 ui.removeTextArea(index,playerName)
  662.             end
  663.             data[playerName].textAreaView=false
  664.         end
  665.     elseif id>10 then
  666.         data[playerName].skill=callback
  667.         table.insert(mices[callback],playerName)
  668.         updateTextArea(playerName)
  669.         for id=10,14 do
  670.             ui.removeTextArea(id,playerName)
  671.         end
  672.     end
  673. end
  674. for playerName in pairs(tfm.get.room.playerList) do
  675.     eventNewPlayer(playerName)
  676. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement