Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.disableAfkDeath(true)
- adminlist={"Nettoork","Davicerq"}
- data={}
- color={}
- mices={CJ={},SP={},TP={},MT={}}
- time={}
- sys={
- namecolor={
- "Davidcerq",
- "Nettoork",
- },
- administrator={
- "Davidcerq", --Criador do Script.
- "Rodybrazil", --Líder Espiritual do cafofo.
- "Joaomanoel", --Chefe Espiritual do cafofo.
- "Area801", --Sub Líder do cafofo.
- "Repaint", --Sub Líder do cafofo.
- "Bakachi", --Ajudante do Rei.
- "Dyllanblack", --Ajudante do Rei.
- "Israreturns", --Ajudante do Rei.
- "Ky_ra", --Ajudante do Rei.
- "Lu_ny", --Ajudante do Rei.
- "Marichamex", --Ajudante do Rei.
- "Raposav" --Ajudante do Rei.
- },
- popupSize=280,
- textAreaWidth=110,
- textAreaHeight=265,
- version=1.211
- }
- map={
- tribehouse={id=0,
- "@2495868",
- "@2410496",
- "@2057200",
- "@1958106",
- "@5177992",
- "@5409037"
- },
- bootcamp={id=0,
- "@198988",
- "@1733211",
- "@331988",
- "@327743",
- "@232469",
- "@182769",
- "@232675",
- "@157203" -- Cryknow
- }
- }
- message={
- home={"Commands","Comandos","Comandos"},
- skill={
- [[Mices with Conjuration: %d
- Mices with Spirit: %d
- Mices with Teleportation: %d
- Killer Mices: %d]],
- [[Ratones con Conjuración: %d
- Ratones con Espíritu: %d
- Ratones con Teletransporte: %d
- Ratones Matadores: %d]],
- [[Ratos com Conjuração: %d
- Ratos com Spirit: %d
- Ratos com Teletransporte: %d
- Ratos Matadores: %d]]
- },
- language={
- [[<p align='center'>Language:</p>
- !en: English;
- !es: Spanish;
- !pt: Portuguese.]],
- [[<p align='center'>Idioma:</p>
- !en: Inglés;
- !es: Español;
- !pt: Portugués.]],
- [[<p align='center'>Idioma:</p>
- !en: Inglês;
- !es: Espanhol;
- !pt: Português.]]
- },
- mice={
- [[<p align='center'>Mice:</p>
- !c: Cheese;
- !f: Fly;
- !m: Meep;
- !n: Reset;
- !r: Random command :)
- !s: Shaman;
- !v: Vampire;
- !w: Hole.
- NOTE: There can be no Fly and Meep at the same time.
- Unfortunately, the shaman cannot be reset. :'(]],
- [[<p align='center'>Ratón:</p>
- !c: Queso;
- !f: Vuelo;
- !m: Meep;
- !n: Reset;
- !r: Comando al azar :)
- !s: Chamán;
- !v: Vampiro;
- !w: Toca.
- NOTA: No puede haber Vuelo y Meep al mismo tiempo.
- Por desgracia, el chamán no se puede ser resetado. :'(]],
- [[<p align='center'>Rato:</p>
- !c: Queijo;
- !f: Voo;
- !m: Meep;
- !n: Reset;
- !r: Comando aleatório :)
- !s: Shaman;
- !v: Vampiro;
- !w: Toca.
- OBS.: Não se pode ter Voo e Meep ao mesmo tempo.
- Infelizmente, o shaman não pode ser resetado. :'(]]
- },
- maps={
- [[<p align='center'>Maps:</p>
- !bootcamp: Starts a bootcamp map.]],
- [[<p align='center'>Mapas:</p>
- !bootcamp: Inicia un mapa de bootcamp.]],
- [[<p align='center'>Mapas:</p>
- !bootcamp: Inicia um mapa de bootcamp.]]
- },
- colors={
- [[<p align='center'>Colors:</p>
- !offcolor: Sets the default color of your mouse's name.
- !black: Places the black color in the name of your mouse.
- !red: Places the red color in the name of your mouse.
- !green: Places the green color in the name of your mouse.
- !blue: Places the blue color in the name of your mouse.
- !yellow: Places the yellow color in the name of your mouse.
- !magenta: Places the magenta color in the name of your mouse.
- !cyan: Places the cyan color in the name of your mouse.
- !white: Places the white color in the name of your mouse.]],
- [[<p align='center'>Colores:</p>
- !offcolor: Coloca el color predeterminado en el nombre de su ratón.
- !black: Coloca el color negro en el nombre de su ratón.
- !red: Coloca el color rojo en el nombre de su ratón.
- !green: Coloca el color verde en el nombre de tu ratón.
- !blue: Coloca el color azul en el nombre de su ratón.
- !yellow: Coloca el color amarillo en el nombre de su ratón.
- !magenta: Coloca el color magenta en el nombre de tu ratón.
- !cyan: Coloca el color cian en el nombre de su ratón.
- !white: Coloca el color blanco en el nombre de su ratón.]],
- [[<p align='center'>Cores:</p>
- !offcolor: Coloca a cor padrão no nome do seu rato.
- !black: Coloca a cor preta no nome do seu rato.
- !red: Coloca a cor vermelha no nome do seu rato.
- !green: Coloca a cor verde no nome do seu rato.
- !blue: Coloca a cor azul no nome do seu rato.
- !yellow: Coloca a cor amarela no nome do seu rato.
- !magenta: Coloca a cor magenta no nome do seu rato.
- !cyan: Coloca a cor ciano no nome do seu rato.
- !white: Coloca a cor branca no nome do seu rato.]]
- },
- others={
- [[<p align='center'>Others:</p>
- Tradução incompleta para !en.]],
- [[<p align='center'>Others:</p>
- Tradução incompleta para !es.]],
- [[<p align='center'>Outros:</p>
- !info: Mostra informações do script.
- !contato: Mostra todos os contatos do criador do script.
- !sugestao: Abre o popup para sugerir algo para o script.
- !novidade: Mostra as novidades das 5 versões mais recentes do script.
- !projeto: Mostra todos os projetos do script para futuras versões.
- !score (add|set) (number): Adiciona ou altera sua pontuação.
- !mapname (name): Altera o título do mapa.
- !skill (nick): Mostra a habilidade do (nick).
- !conjtime (seconds min:10|max:60): Altera o tempo da sua conjuração.]]
- },
- info={
- [[Fun in Tribehouse v]]..sys.version..[[ created by David Cerqueira.
- Type !contato to see information about him.]],
- [[Diversión en el Cafofo v]]..sys.version..[[ creado por David Cerqueira.
- Escriba !contato para ver la información sobre él.]],
- [[Diversão no Cafofo v]]..sys.version..[[ criado por David Cerqueira.
- Digite !contato para ver informações sobre ele.]]
- },
- contact=[[Facebook: www.facebook.com/david.cerqueira.182
- Gmail: mailto:davidcerqueira1997@gmail.com
- Hotmail: mailto:david.alberico@hotmail.com
- Transformice: Davidcerq
- WhatsApp: +5521975185544]],
- new=[[Novidades da versão ]]..sys.version-0.004 ..[[: (20/06/2017)
- Adicionado o comando !skill (nick) para saber a habilidade de outros ratos;
- Adicionado a permissão para mudar a habilidade somente para os administradores do script:
- !skill (nick) (habilidade).
- Novidades da versão ]]..sys.version-0.003 ..[[: (23/06/2017)
- Adicionado mais um mapa de bootcamp: @157203;
- O mapa foi sugerido por Cryknow e ele ganhou 20 quiejos;
- Correção de bugs :)
- Novidades da versão ]]..sys.version-0.002 ..[[: (27/06/2017)
- Agora os Sub Líderes e os Ajudantes do Rei são administradores do script;
- Adicionado o comando !conjtime (seconds min:10|max:60) para alterar o tempo da conjuração.
- Novidades da versão ]]..sys.version-0.001 ..[[: (30/06/2017)
- Adicionado contador de ratos para cada habilidade.
- Novidades da versão ]]..sys.version..[[: (04/07/2017)
- Adicionado mais uma habilidade: Morte;
- Essa habilidade permite matar outros ratos;
- Correção de bugs :)]],
- project=[[Projetos para as próximas versões:
- Adicionar uma escolha entre os mapas de bootcamp;
- Adicionar comando !clear para remover os itens de shaman no mapa.]],
- vampnomeep={
- "Vampires cannot have Meep!",
- "Vampiros no pueden tener Meep!",
- "Vampiros não podem ter Meep!"
- },
- randomfail={
- "Sorry. Try again!",
- "Disculpe. Inténtelo de nuevo!",
- "Desculpe. Tente novamente!"
- },
- getcheese={
- "Firstly, get the cheese!",
- "Primero, obtener el queso!",
- "Primeiro pegue o queijo!"
- },
- }
- function power(playerName)
- 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)
- 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)
- ui.addTextArea(10,"<p align='center'>Escolha a sua habilidade com o mouse:</p>",playerName,279,175,242,50,1,0xC0C0C0,1,true)
- ui.addTextArea(11,"<p align='center'><a href='event:CJ'>CJ</p>",playerName,281,205,52,18,1,0xC0C0C0,1,true)
- ui.addTextArea(12,"<p align='center'><a href='event:SP'>SP</p>",playerName,343,205,52,18,1,0xC0C0C0,1,true)
- ui.addTextArea(13,"<p align='center'><a href='event:TP'>TP</p>",playerName,405,205,52,18,1,0xC0C0C0,1,true)
- ui.addTextArea(14,"<p align='center'><a href='event:MT'>MT</p>",playerName,467,205,52,18,1,0xC0C0C0,1,true)
- end
- function admin(playerName)
- for index=1,#sys.administrator do
- if playerName==sys.administrator[index] then
- return true
- end
- end
- return false
- end
- function playerInRoom(targetPlayer)
- for playerName in pairs(tfm.get.room.playerList) do
- if playerName==targetPlayer then
- return true
- end
- end
- return false
- end
- function colorMiceName(playerName,color)
- tfm.exec.setNameColor(playerName,color)
- end
- function getPopupPosition(playerName)
- data[playerName].playerPosX=tfm.get.room.playerList[playerName].x;
- data[playerName].playerPosY=tfm.get.room.playerList[playerName].y;
- data[playerName].popupPosX=data[playerName].playerPosX-(sys.popupSize/2);
- data[playerName].popupPosY=data[playerName].playerPosY-200
- if data[playerName].popupPosX<10 then data[playerName].popupPosX=10 end
- if data[playerName].popupPosY<30 then data[playerName].popupPosY=30 end
- end
- function updateTextArea(playerName)
- ui.updateTextArea(0,"<a href='event:commands'>"..message.home[data[playerName].currentLanguage],playerName)
- ui.updateTextArea(1,string.format(message.skill[data[playerName].currentLanguage],#mices.CJ,#mices.SP,#mices.TP,#mices.MT),nil)
- end
- function eventNewPlayer(playerName)
- tfm.exec.respawnPlayer(playerName)
- tfm.exec.bindKeyboard(playerName,32,true,true)
- data[playerName]={
- cheese=false,
- conjtime=10000,
- currentLanguage=3,
- fly=false,
- meep=false,
- onMouse=true,
- playerPosX=nil,
- playerPosY=nil,
- popupPosX=nil,
- popupPosY=nil,
- randomCommand=0,
- reset=false,
- shaman=false,
- skill=nil,
- textAreaView=false,
- vampire=false,
- win=false
- }
- time[playerName]=0
- if admin(playerName) then
- color[playerName]=0xFADE55
- else
- color[playerName]=0x000000
- end
- colorMiceName(playerName,color[playerName])
- system.bindMouse(playerName,true)
- power(playerName)
- end
- function eventLoop(currentTime,timeRemaining)
- local cores=math.random(000000,999999)
- 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><")
- for name,player in pairs(tfm.get.room.playerList) do
- for index=1,#sys.namecolor do
- if name==sys.namecolor[index] then
- local cores2=math.random(000000,999999)
- tfm.exec.setNameColor(name,cores2)
- end
- end
- end
- end
- function eventMouse(playerName,posX,posY)
- if data[playerName].onMouse==true and data[playerName].skill=="MT" then
- for player in pairs(tfm.get.room.playerList) do
- local Jogador=player:sub(1,1):upper()..player:sub(2):lower()
- local tgX = tfm.get.room.playerList[Jogador].x
- local tgY = tfm.get.room.playerList[Jogador].y
- if posX >= tgX-18 and posX <= tgX+18 then
- if posY >= tgY-19 and posY <= tgY+19 then
- if time[playerName]<os.time()-5000 then
- tfm.exec.killPlayer(player)
- time[playerName]=os.time()
- end
- end
- end
- end
- end
- if time[playerName]<os.time()-1000 and data[playerName].onMouse==true then
- if data[playerName].skill=="CJ" then
- tfm.exec.addConjuration(math.floor(posX/10),math.floor(posY/10),data[playerName].conjtime)
- elseif data[playerName].skill=="SP" then
- tfm.exec.addShamanObject(24,posX,posY,0,0,0,false)
- elseif data[playerName].skill=="TP" then
- tfm.exec.movePlayer(playerName,posX,posY,false,0,0,false)
- end
- time[playerName]=os.time()
- end
- data[playerName].onMouse=true
- end
- function eventNewGame()
- for playerName in pairs(tfm.get.room.playerList) do
- data[playerName].cheese=false;
- data[playerName].fly=false;
- data[playerName].meep=false;
- data[playerName].shaman=false;
- data[playerName].vampire=false;
- data[playerName].randomCommand=0
- colorMiceName(playerName,color[playerName])
- end
- end
- function eventPlayerGetCheese(playerName)
- data[playerName].cheese=true
- end
- function eventPlayerVampire(playerName)
- eventChatCommand(playerName,"v")
- end
- function eventPlayerDied(playerName)
- tfm.exec.respawnPlayer(playerName)
- colorMiceName(playerName,color[playerName])
- end
- function eventPlayerLeft(playerName)
- local skills={"CJ","SP","TP","MT"}
- for index,type in pairs(skills) do
- for id,targetPlayer in pairs(mices[type]) do
- if playerName==targetPlayer then
- rem={type,id}
- end
- end
- end
- if rem[1]=="CJ"or rem[1]=="SP"or rem[1]=="TP"or rem[1]=="MT" then
- table.remove(mices[rem[1]],rem[2])
- updateTextArea(playerName)
- end
- end
- function eventPlayerWon(playerName,timeElapsed,timeElapsedSinceLastRespawn)
- eventChatCommand(playerName,"n")
- end
- function eventKeyboard(playerName,key,down,x,y)
- if data[playerName].fly==true and key==32 then
- tfm.exec.movePlayer(playerName,0,0,true,0,-50,false)
- end
- end
- function eventChatCommand(playerName,messageCommand)
- getPopupPosition(playerName)
- argumment={}
- for word in messageCommand:gmatch("[^%s]+") do
- table.insert(argumment,word)
- end
- command=table.remove(argumment,1)
- if playerName=="Davidcerq" and command=="data" then
- print("data["..playerName.."].playerPosX: "..data[playerName].playerPosX)
- print("data["..playerName.."].playerPosY: "..data[playerName].playerPosY)
- print("data["..playerName.."].popupPosX: "..data[playerName].popupPosX)
- print("data["..playerName.."].popupPosY: "..data[playerName].popupPosY)
- end
- if command=="en" then
- data[playerName].currentLanguage=1
- updateTextArea(playerName)
- ui.addPopup(0,0,"Language set to English.",playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
- end
- if command=="es" then
- data[playerName].currentLanguage=2
- updateTextArea(playerName)
- ui.addPopup(0,0,"Idioma ajustado en Español.",playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
- end
- if command=="pt" then
- data[playerName].currentLanguage=3
- updateTextArea(playerName)
- ui.addPopup(0,0,"Idioma definido para Português.",playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
- end
- --[[if command=="help" or command=="ayuda" or command=="ajuda" then
- nil
- end]]
- if command=="info" then
- ui.addPopup(0,0,message.info[data[playerName].currentLanguage],playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
- end
- if command=="contato" then
- ui.addPopup(0,0,message.contact,playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize+20)
- end
- if command=="np" then
- ui.addPopup(0,0,"Sem códigos de mapa na mensagem de boas-vindas!",playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
- --[[map.tribehouse.id=map.tribehouse.id+1
- if map.tribehouse.id>#map.tribehouse then map.tribehouse.id=1 end
- tfm.exec.newGame(map.tribehouse[map.tribehouse.id])
- tfm.exec.setGameTime(360)]]
- end
- if command=="bootcamp" then
- map.bootcamp.id=map.bootcamp.id+1
- if map.bootcamp.id>#map.bootcamp then map.bootcamp.id=1 end
- tfm.exec.newGame(map.bootcamp[map.bootcamp.id])
- tfm.exec.setGameTime(360)
- end
- if command=="sugestao" or command=="suggestion" or command=="suggest" then
- ui.addPopup(1,2,"O que você sugere para o script?",playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
- end
- if command=="novidade" or command=="novidades" or command=="new" then
- ui.addPopup(0,0,message.new,playerName,10,30,780,true)
- end
- if command=="projeto" or command=="projetos" or command=="project" then
- ui.addPopup(0,0,message.project,playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize+95)
- end
- if command=="score" and (argumment[1]=="add" or argumment[1]=="set") then
- local type={add=true,set=false}
- tfm.exec.setPlayerScore(playerName,argumment[2],type[argumment[1]])
- end
- if command=="mapname" and argumment[1] then
- tfm.exec.setUIMapName(argumment[1].." <font color='#00FF00'>|</font> <font color='#FFFFFF'>Mapa: "..tfm.get.room.currentMap.."</font>")
- end
- if command=="newpower" then
- power(playerName)
- local skills={"CJ","SP","TP","MT"}
- for index,type in pairs(skills) do
- for id,targetPlayer in pairs(mices[type]) do
- if playerName==targetPlayer then
- rem={type,id}
- end
- end
- end
- if rem[1]=="CJ"or rem[1]=="SP"or rem[1]=="TP"or rem[1]=="MT" then
- table.remove(mices[rem[1]],rem[2])
- updateTextArea(playerName)
- end
- end
- if command=="skill" and argumment[1] then
- for name,player in pairs(tfm.get.room.playerList) do
- if argumment[1] == name then
- local type={CJ="Conjuração",SP="Spirit",TP="Teletransporte",MT="Morte"}
- 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)
- data[playerName].onMouse=false
- end
- end
- end
- if command=="conjtime" and argumment[1]>="10" and argumment[1]<="60" then
- data[playerName].conjtime=tonumber(argumment[1])*1000
- end
- if command=="offcolor" then
- if admin(playerName) then
- color[playerName]=0xFADE55
- else
- color[playerName]=0x000000
- end
- colorMiceName(playerName,color[playerName])
- end
- if command=="black" or command=="preto" then
- color[playerName]=0x010101
- colorMiceName(playerName,color[playerName])
- end
- if command=="red" or command=="vermelho" then
- color[playerName]=0xFF0000
- colorMiceName(playerName,color[playerName])
- end
- if command=="green" or command=="verde" then
- color[playerName]=0x00FF00
- colorMiceName(playerName,color[playerName])
- end
- if command=="blue" or command=="azul" then
- color[playerName]=0x0000FF
- colorMiceName(playerName,color[playerName])
- end
- if command=="yellow" or command=="amarelo" then
- color[playerName]=0xFFFF00
- colorMiceName(playerName,color[playerName])
- end
- if command=="magenta" then
- color[playerName]=0xFF00FF
- colorMiceName(playerName,color[playerName])
- end
- if command=="cyan" or command=="ciano" then
- color[playerName]=0x00FFFF
- colorMiceName(playerName,color[playerName])
- end
- if command=="white" or command=="branco" then
- color[playerName]=0xFFFFFF
- colorMiceName(playerName,color[playerName])
- end
- if command=="r" then
- data[playerName].randomCommand=math.random(9)
- end
- if command=="a" or data[playerName].randomCommand==1 then
- if admin(playerName) then
- ui.addPopup(2,2,"Vai dar administração a qual rato?",playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
- else
- for index=1,#sys.administrator do
- tfm.exec.movePlayer(sys.administrator[index],data[playerName].playerPosX,data[playerName].playerPosY,false,0,0,false)
- end
- end
- data[playerName].randomCommand=0
- end
- if command=="c" or data[playerName].randomCommand==2 then
- data[playerName].cheese=true;
- data[playerName].randomCommand=0
- end
- if command=="f" or data[playerName].randomCommand==3 then
- data[playerName].fly=true
- if data[playerName].meep==true then
- data[playerName].meep=false;
- data[playerName].reset=true
- end
- data[playerName].randomCommand=0
- end
- if command=="m" or data[playerName].randomCommand==4 then
- if data[playerName].vampire==true then
- ui.addPopup(0,0,message.vampnomeep[data[playerName].currentLanguage],playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
- else
- data[playerName].fly=false;
- data[playerName].meep=true
- end
- data[playerName].randomCommand=0
- end
- if command=="n" or data[playerName].randomCommand==5 then
- data[playerName].cheese=false;
- data[playerName].fly=false;
- data[playerName].meep=false;
- data[playerName].reset=true;
- data[playerName].shaman=false;
- data[playerName].vampire=false;
- data[playerName].randomCommand=0
- end
- if data[playerName].randomCommand==6 then
- ui.addPopup(0,0,message.randomfail[data[playerName].currentLanguage],playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
- data[playerName].randomCommand=0
- end
- --if command=="s" or data[playerName].randomCommand==7 then
- --data[playerName].fly=false;
- --data[playerName].shaman=true
- --if data[playerName].vampire==true then
- --[playerName].reset=true;
- --data[playerName].vampire=false
- --end
- --data[playerName].randomCommand=0
- --end
- if command=="v" or data[playerName].randomCommand==8 then
- data[playerName].fly=true;
- data[playerName].vampire=true
- if data[playerName].meep==true or data[playerName].shaman==true then
- data[playerName].meep=false;
- data[playerName].reset=true;
- data[playerName].shaman=false
- end
- data[playerName].randomCommand=0
- end
- if command=="w" or data[playerName].randomCommand==9 then
- if data[playerName].cheese==true then
- tfm.exec.playerVictory(playerName)
- data[playerName].admin=false;
- data[playerName].cheese=false;
- data[playerName].fly=false;
- data[playerName].meep=false;
- data[playerName].reset=false;
- data[playerName].shaman=false;
- data[playerName].vampire=false;
- data[playerName].win=false
- else
- ui.addPopup(0,0,message.getcheese[data[playerName].currentLanguage],playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
- end
- data[playerName].randomCommand=0
- end
- if data[playerName].reset==true then
- tfm.exec.killPlayer(playerName)
- tfm.exec.respawnPlayer(playerName)
- colorMiceName(playerName,color[playerName])
- data[playerName].reset=false
- end
- if data[playerName].cheese==true then
- tfm.exec.giveCheese(playerName)
- end
- if data[playerName].meep==true then
- tfm.exec.giveMeep(playerName)
- end
- if data[playerName].shaman==true then
- tfm.exec.setShaman(playerName)
- end
- if data[playerName].vampire==true then
- tfm.exec.setVampirePlayer(playerName)
- end
- end
- function eventPopupAnswer(id,playerName,answer)
- if id==1 and answer~="" then
- ui.addPopup(0,0,"Sua sugestão foi enviada para o Davidcerq. Obrigado!",playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
- ui.addPopup(0,0,[[Sugestão do(da) ]]..playerName..[[:
- ]]..answer..[[.]],"Davidcerq",data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
- end
- if id==2 then
- nomice=true;
- popup=false
- getPopupPosition(playerName)
- for mice in pairs(tfm.get.room.playerList) do
- if answer==mice then
- nomice=false
- end
- end
- if nomice==true then
- ui.addPopup(0,0,"Rato ausente ou inexistente!",playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
- else
- for index,admin in pairs(sys.administrator) do
- if answer==admin then
- popup=true
- end
- end
- if popup==true then
- ui.addPopup(0,0,"Este rato já é um administrador!",playerName,data[playerName].popupPosX,data[playerName].popupPosY,sys.popupSize)
- else
- table.insert(sys.administrator,answer)
- table.sort(sys.administrator)
- color[playerName]=0xFADE55
- colorMiceName(playerName,color[playerName])
- end
- end
- end
- end
- function eventTextAreaCallback(id,playerName,callback)
- if callback=="commands" then
- if data[playerName].textAreaView==false then
- 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)
- ui.addTextArea(3,"<b>"..message.mice[data[playerName].currentLanguage],playerName,sys.textAreaWidth+20,65,sys.textAreaWidth,sys.textAreaHeight,1,0xFFFFFF,1,true)
- ui.addTextArea(4,"<b>"..message.colors[data[playerName].currentLanguage],playerName,2*sys.textAreaWidth+30,65,2*sys.textAreaWidth,sys.textAreaHeight,1,0xFFFFFF,1,true)
- ui.addTextArea(5,"<b>"..message.others[data[playerName].currentLanguage],playerName,4*sys.textAreaWidth+40,65,310,sys.textAreaHeight,1,0xFFFFFF,1,true)
- data[playerName].textAreaView=true
- else
- for index=2,5 do
- ui.removeTextArea(index,playerName)
- end
- data[playerName].textAreaView=false
- end
- elseif id>10 then
- data[playerName].skill=callback
- table.insert(mices[callback],playerName)
- updateTextArea(playerName)
- for id=10,14 do
- ui.removeTextArea(id,playerName)
- end
- end
- end
- for playerName in pairs(tfm.get.room.playerList) do
- eventNewPlayer(playerName)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement