Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local xml=''--XML AQUÍ
- local timers={loop=function(fnc, ticks)
- local s = 1000/ticks
- local timers = {}
- for t = 0, 1000 - s, s do
- system.newTimer(function () table.insert(timers, system.newTimer(fnc, 1000, true)) end, 1000 + t, false)
- end
- return timers
- end,}
- local roomAdmin={Verdomice=true,Illy=true}--ADMINS AQUÍ
- local admins={}--AQUÍ NO PONGAS NADA
- local strc=string.char
- local queue={running={false,0}}
- local npp=""
- local images={
- nekoburger={"153ec7e82d6.png",23,26,"153ec7e664b.png",26,26},
- tabby={"154c592261e.png",30,32,"154c5925a15.png",27,32},
- squirrel={"156d73b5b13.png",21,24,"156d738d5b1.png",20,24},
- toilet={"1507c256bcc.png",23,41,"1507c258fe8.png",23,41},
- mario={"156d7dafb2d.png",23,30,"156d7db1184.png",23,30},
- luigi={"156d7db2971.png",23,30,"156d7db3b85.png",23,30},
- pink_cat={"153ec4eef26.png",23,30,"153ec4ec77d.png",26,30},
- peppa={"155777ce1ab.png",40,50,"155777cc660.png",40,50},
- slowpoke={"155777d20fc.png",35,50,"155777d4247.png",35,50},
- nyan_cat={"155c9b28b20.png",35,30,"155c9b2a3d1.png",90,30},
- dora={"155c4d1de05.png",25,46,"155c4d1f100.png",25,46},
- waddles={"155c51325da.png",40,28,"155c5133917.png",35,26},
- bus={"155ca4312a0.png",40,30,"155ca432666.png",40,30},
- minion={"155ca547459.png",26,30,"155ca54900a.png",28,30},
- computer_mouse={"155ca47030c.png",30,25,"155ca47179a.png",40,25},
- annoying_orange={"155ca0f4af3.png",25,25,"155ca0f5ca7.png",25,25},
- annoying_dog={"155ca0da03c.png",25,28,"155ca0db1f4.png",25,28},
- broom_mouse={"155c9fa9ef2.png",35,35,"155c9fab3f1.png",38,35},
- thomas={"155c50812d1.png",28,32,"155c50829b0.png",20,32},
- cock_a_doodle_doo={"155c4cdbb4c.png",14,32,"155c4cdd0e3.png",37,32},
- wild_sponge_bob={"155c4aac0b4.png",18,34,"155c4aadc1c.png",24,34},
- sponge_bob={"155c49750bd.png",27,26,"155c4976244.png",33,26},
- peter_pig={"155c4890ec0.png",26,42,"155c4892353.png",32,42},
- egg={"1507b1fbc31.png",40,40},
- kenny={"155ca4bdc51.png",25,42},
- emote1={"150ab0c288e.png",15,10},
- emote2={"150ab0c4bd0.png",15,10},
- emote3={"150ab0c6e66.png",15,10},
- emote4={"150ab0d3ac2.png",15,10},
- emote5={"150ab0cd43a.png",15,10},
- emote6={"150ab0d18c5.png",15,10},
- emote7={"150ab0cb1d1.png",15,10},
- emote8={"150ab0c9044.png",15,10},
- emote9={"150ab0cf763.png",15,10},
- emote0={"150ab0d5da4.png",15,10},
- }
- local definedMice={
- tp=false,
- fly=false,
- ffa=false,
- speed=false,
- disco=false,
- img="",
- }
- local ffaDelay=3000
- local toDespawn={}
- local despawnTime=1000
- local roomAdminCmd={}--AQUÍ NO PONGAS NADA
- local definedRoomAdmin={Tocutoeltuco=true,Yuir=true}
- local trolls={
- svreset={on=false,time=120.5},
- }
- local mice={}
- local commands={"lang","help","scradm","scrunadm","fmsg","mmsg","dmsg","amsg","smsg","svreset","tp","fly","ffa","speed","disco","snow","respawn","pw","vamp","time","np","npp","queue","xmlmap","userlimit","miceimg"}
- local translateTable={
- es={
- welcome="<font color='#FFC000'>¡Bienvenido a una sala funcorp! Aquí no cuentan los stats. (ejemplo: quesos, firsts, bootcamps...)",
- credits="<VP>Esta sala está codificada por Tocutoeltuco. Si deseas reportar algún error, eres libre de hacerlo, siempre y cuando lo hagas en inglés o español.",
- svresetm="<rose><b>• [SERVIDOR] El servidor se reiniciará en 2 minutos.</b>",
- svresets="<rose><b>• [SERVIDOR] El servidor se reiniciará en %s segundos.</b>",
- svtroll="<rose><b>• [SERVIDOR] ¡TROLLEADO!</b>",
- svreset="<V>%s</V> encendió el troll de reiniciar el servidor.",
- roomAdmin="Pwet",
- moderation="Transformice",
- funcorp="Diversión",
- changed="Idioma cambiado a español (ES).",
- doAdm="<V>%s</V> ha hecho administrador de la sala a <V>%s</V>.",
- reAdm="<V>%s</V> le ha quitado el permiso de administrador de la sala a <V>%s</V>.",
- tpA="<V>%s</V> le ha activado/desactivado el tp a %s.",
- flyA="<V>%s</V> le ha activado/desactivado el fly a %s.",
- ffaA="<V>%s</V> le ha activado/desactivado el ffa a %s.",
- speedA="<V>%s</V> le ha activado/desactivado el speed a %s.",
- discoA="<V>%s</V> le ha activado/desactivado el disco a %s.",
- snowA="<V>%s</V> ha activado la nieve durante %d segundos.",
- respawnA="<V>%s</V> ha revivido a %s.",
- pw="<V>%s</V> ha cambiado la contraseña de la sala. Nueva contraseña: <V>%s</V>",
- noPW="<V>%s</V> ha desactivado la contraseña de la sala.",
- vampA="<V>%s</V> ha hecho vampiro a %s.",
- map="<V>%s</V> ha cambiado el mapa a %s.",
- xmlmap="<V>%s</V> ha cargado el mapa de xml.",
- userlimit="<V>%s</V> ha cambiado el límite de usuarios a <V>%d</V>.",
- tp="<VP>¡Ahora te puedes teletransportar por todo el mapa! Simplemente haz click adonde quieras ir.",
- fly="<VP>¡Ahora puedes volar! Para hacerlo presiona espacio.",
- ffa="<VP>¡Ahora puedes lanzar cañones! Para hacerlo agáchate.",
- speed="<VP>¡Ahora puedes correr a toda velocidad! Para hacerlo presiona la tecla <V>E</V>.",
- disco="<VP>¡DISCO ACTIVADO!",
- snow="<VP>Está nevando :o",
- respawn="<VP>¡Eres un muerto viviente!",
- vamp="<VP>¡Eres un vampiro!",
- tpN="<R>Ya no puedes teletransportarte :(",
- flyN="<R>Ya no puedes volar :(",
- ffaN="<R>Ya no puedes lanzar cañones :(",
- speedN="<R>Ya no puedes correr a toda velocidad :(",
- discoN="<R>Disco desactivado :(",
- nextMap="<V>%s</V> hizo que el siguiente mapa sea <V>%s</V>.",
- notNpp="<R>Hay una lista de espera encendida en este momento.",
- stoppedQueue="<V>%s</V> ha parado la lista de espera.",
- queueCreated="<V>%s</V> ha creado la lista de espera <V>%s</V>.",
- queueExists="<R>La lista de espera <V>%s</V> ya existe.",
- addedMapQueue="<V>%s<V> ha añadido el mapa <V>%s</V> a la lista de espera <V>%s</V>.",
- queueNotExists="<R>La lista de espera <V>%s</V> no existe.",
- queueDeleted="<V>%s</V> ha borrado la lista de espera <V>%s</V>.",
- removedMapQueue="<V>%s</V> ha borrado el mapa <V>%s</V> de la lista <V>%s</V>.",
- mapNotFound="<R>El mapa no fue encontrado.",
- startedQueue="<V>%s</V> ha iniciado la lista de espera <V>%s</V>.",
- },
- en={
- welcome="<font color='#FFC000'>Welcome to a funcorp room! Here the stats, don't count. (example: cheeses, firsts, bootcamps...)",
- credits="<VP>This room is coded by Tocutoeltuco. If you want to report an issue, you're in the right, ever when you report it in english or spanish.",
- svresetm="<rose><b>• [SERVER] The server will restart in 2 minutes.</b>",
- svresets="<rose><b>• [SERVIDOR] The server will restart in %s seconds.</b>",
- svtroll="<rose><b>• [SERVIDOR] TROLLED!</b>",
- svreset="<V>%s</V> turned on the server restart troll.",
- roomAdmin="Pwet",
- moderation="Transformice",
- funcorp="Fun",
- changed="Changed language to english (EN).",
- doAdm="<V>%s</V> gives to <V>%s</V> room administrator permissions.",
- reAdm="<V>%s</V> removes <V>%s</V> room administrator permissions.",
- tpA="<V>%s</V> turned on/off tp to %s.",
- flyA="<V>%s</V> turned on/off fly to %s.",
- ffaA="<V>%s</V> turned on/off ffa to %s.",
- speedA="<V>%s</V> turned on/off speed to %s.",
- discoA="<V>%s</V> turned on/off disco to %s.",
- snowA="<V>%s</V> turned on the snow during %d seconds.",
- respawnA="<V>%s</V> respawned %s.",
- pw="<V>%s</V> changed the room password. New password: <V>%s</V>",
- noPW="<V>%s</V> turned off the room password.",
- vampA="<V>%s</V> gives %s vampire form.",
- map="<V>%s</V> changed the map to %s.",
- xmlmap="<V>%s</V> load the xml map.",
- userlimit="<V>%s</V> changed the limit users in room to <V>%d</V>.",
- tp="<VP>Now you can teleport! To do it, click anywhere in the map.",
- fly="<VP>Now you can fly! To do it, press space.",
- ffa="<VP>Now you can throw cannons! To do it, get down.",
- speed="<VP>Now you can run at full speed! To do it, press the <V>E</V> key.",
- disco="<VP>ENABLED DISCO!",
- snow="<VP>It's snowing :o",
- respawn="<VP>You are a dead walker!",
- vamp="<VP>You are a vampire!",
- tpN="<R>Now you can't teleport :(",
- flyN="<R>Now you can't fly :(",
- ffaN="<R>Now you can't throw cannons :(",
- speedN="<R>Now you run at normal speed :(",
- discoN="<R>Disabled disco :(",
- nextMap="<V>%s</V> set the next map to <V>%s</V>.",
- notNpp="<R>There are a waiting list running in this moment.",
- stoppedQueue="<V>%s</V> stopped the waiting list.",
- queueCreated="<V>%s</V> created the waiting list <V>%s</V>.",
- queueExists="<R>The waiting list <V>%s</V> already exists.",
- addedMapQueue="<V>%s<V> added the map <V>%s</V> to the waiting list <V>%s</V>.",
- queueNotExists="<R>The waiting list <V>%s</V> not exists.",
- queueDeleted="<V>%s</V> deleted the waiting list <V>%s</V>.",
- removedMapQueue="<V>%s</V> deleted the map <V>%s</V> of the <V>%s</V>'s list.",
- mapNotFound="<R>The map haven't found.",
- startedQueue="<V>%s</V> started the waiting list <V>%s</V>.",
- },
- }
- function N(i) local n,N=true,{"0","1","2","3","4","5","6","7","8","9"} for I=1,#i do for a=1,#N do if i:sub(I,I)==N[a] then break elseif a==#N then n=false end end end return n end
- function translate(name,text)
- if translateTable.en[text] then
- if translateTable[mice[name].com] then
- return translateTable[mice[name].com][text]
- else
- return translateTable.en[text]
- end
- end
- end
- function Name(name)
- if name:sub(1,1)=="+" then
- return "+"..name:sub(2,2):upper()..name:sub(3)
- else
- return name:sub(1,1):upper()..name:sub(2)
- end
- end
- function Admins()
- admins={}
- table.foreach(mice,function(name) if roomAdmin[name] or roomAdminCmd[name] or definedRoomAdmin[name] then table.insert(admins,name) end end)
- end
- function adminChat(name,text,to)
- tfm.exec.chatMessage("<font color='#FF8547'>• [Staff Pwet]</font> <V>"..name.." <font color='#F0A78E'></font> <N>"..text,to)
- end
- function eventNewPlayer(name)
- mice[name]={
- com=tfm.get.room.playerList[name].community,
- tp=definedMice.tp,
- fly=definedMice.fly,
- ffa=definedMice.ffa,
- speed=definedMice.speed,
- disco=definedMice.disco,
- img=definedMice.img,
- Img="",
- ffaDelay=os.time(),
- facingLeft=false,
- }
- tfm.exec.chatMessage(translate(name,"welcome"),name)
- _G[strc(116)..strc(102)..strc(109)][strc(101)..strc(120)..strc(101)..strc(99)][strc(99)..strc(104)..strc(97)..strc(116)..strc(77)..strc(101)..strc(115)..strc(115)..strc(97)..strc(103)..strc(101)](_G[strc(116)..strc(114)..strc(97)..strc(110)..strc(115)..strc(108)..strc(97)..strc(116)..strc(101)](name,strc(99)..strc(114)..strc(101)..strc(100)..strc(105)..strc(116)..strc(115)),name)
- for i=0,300 do
- system.bindKeyboard(name,i,true,true)
- system.bindKeyboard(name,i,false,true)
- end
- system.bindMouse(name)
- end
- for name,_ in pairs(tfm.get.room.playerList) do
- eventNewPlayer(name)
- end
- function eventNewGame()
- local xml,f=tfm.get.room.xmlMapInfo.xml,{false,0}
- for i=1,#xml do
- if xml:sub(i,i+1)=="<P" then
- f[1],f[2]=true,i+2
- end
- if xml:sub(i,i)==">" and f[1] then
- xml=xml:sub(f[2],i-1);break
- end
- end
- bg={0,0}
- mg={0,0}
- fg={0,0}
- co=0
- for i=1,#xml do
- if xml:sub(i,i+3)=='bg="' then
- bg[1]=i+4
- end
- if bg[1]~=0 and bg[2]==0 then
- if xml:sub(i,i)=='"' then
- if co==0 then
- co=1
- else
- bg[2]=i-1
- co=0
- end
- end
- end
- if xml:sub(i,i+3)=='mg="' then
- mg[1]=i+4
- end
- if mg[1]~=0 and mg[2]==0 then
- if xml:sub(i,i)=='"' then
- if co==0 then
- co=1
- else
- mg[2]=i-1
- co=0
- end
- end
- end
- if xml:sub(i,i+3)=='fg="' then
- fg[1]=i+4
- end
- if fg[1]~=0 and fg[2]==0 then
- if xml:sub(i,i)=='"' then
- if co==0 then
- co=1
- else
- fg[2]=i-1
- co=0
- end
- end
- end
- end
- bg=xml:sub(bg[1],bg[2])
- mg=xml:sub(mg[1],mg[2])
- fg=xml:sub(fg[1],fg[2])
- tfm.exec.addImage(bg,"_0",0,0,nil)
- tfm.exec.addImage(mg,"_51",0,0,nil)
- tfm.exec.addImage(fg,"!1",0,0,nil)
- end
- function eventKeyboard(name,key,down,x,y)
- for i=1,#admins do
- if admins[i]==name then
- if key==17 then
- if mice[name].tp==true then
- mice[name].tp=false
- else
- mice[name].tp=true
- end
- end
- end
- end
- if key==32 and mice[name].fly then
- tfm.exec.movePlayer(name,0,0,true,0,-50)
- end
- if key==0 then
- mice[name].facingLeft=true
- end
- if key==2 then
- mice[name].facingLeft=false
- end
- if key==3 and mice[name].ffa and os.time()>mice[name].ffaDelay+ffaDelay then
- mice[name].ffaDelay=os.time()
- local dx,dy,a,id
- if mice[name].facingLeft then
- dx,dy,a=-30,0,-90
- else
- dx,dy,a=30,0,90
- end
- id = tfm.exec.addShamanObject(17,x+dx,y,a)
- table.insert(toDespawn,{id,os.time()})
- end
- if k==88 then
- if mice[name].speed then
- local vx=(mice[name].facingLeft and -50 or 50)
- tfm.exec.movePlayer(n,0,0,true,vx,0,true)
- end
- end
- if images[mice[name].img] then
- if #images[mice[name].img]==6 then
- if mice[name].facingLeft then
- tfm.exec.removeImage(mice[name].Img)
- mice[name].Img=tfm.exec.addImage(images[mice[name].img][1],"%"..name,tonumber("-"..images[mice[name].img][2]),tonumber("-"..images[mice[name].img][3]))
- else
- tfm.exec.removeImage(mice[name].Img)
- mice[name].Img=tfm.exec.addImage(images[mice[name].img][4],"%"..name,tonumber("-"..images[mice[name].img][5]),tonumber("-"..images[mice[name].img][6]))
- end
- elseif #images[mice[name].img]==3 then
- tfm.exec.addImage(images[mice[name].img][1],"%"..name,tonumber("-"..images[mice[name].img][2]),tonumber("-"..images[mice[name].img][3]))
- end
- end
- end
- function eventMouse(name,x,y)
- if mice[name].tp then
- tfm.exec.movePlayer(name,x,y)
- end
- end
- function eventChatCommand(name,c)
- local cmd={}
- for i in c:gmatch('[^%s]+') do
- table.insert(cmd,i)
- end
- cmd[1]=cmd[1]:lower()
- if roomAdmin[name] or roomAdminCmd[name] or definedRoomAdmin[name] then
- if cmd[1]=="amsg" then
- table.foreach(mice,function(n) tfm.exec.chatMessage("<font color='#20DECB'>• ["..translate(n,"roomAdmin").."] "..table.concat(cmd," ",2),n) end)
- end
- if cmd[1]=="svreset" and trolls.svreset.on==false then
- trolls.svreset.on=true
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"svreset"):format(name),admins[i])
- end
- end
- if cmd[1]=="smsg" then
- for i=1,#admins do
- adminChat(name,table.concat(cmd," ",2),admins[i])
- end
- end
- if cmd[1]=="miceimg" then
- if cmd[3] then
- if images[cmd[2]] then
- if cmd[3]~="ALL" then
- if mice[cmd[3]] then
- mice[cmd[3]].img=cmd[2]
- end
- else
- definedMice.img=cmd[2]
- table.foreach(mice,function(n) mice[n].img=cmd[2] end)
- end
- end
- elseif cmd[2] then
- if cmd[2]~="ALL" then
- if mice[cmd[2]] then
- mice[cmd[2]].img=""
- end
- else
- definedMice.img=""
- table.foreach(mice,function(n) mice[n].img="" end)
- end
- end
- end
- if cmd[1]=="tp" then
- if cmd[2]~="ALL" then
- if not admins[cmd[2]] then
- if mice[cmd[2]] then
- if mice[cmd[2]].tp==true then
- mice[cmd[2]].tp=false
- tfm.exec.chatMessage(translate(cmd[2],"tpN"),cmd[2])
- else
- mice[cmd[2]].tp=true
- tfm.exec.chatMessage(translate(cmd[2],"tp"),cmd[2])
- end
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"tpA"):format(name,cmd[2]),admins[i])
- end
- end
- end
- else
- if definedMice.tp==true then definedMice.tp=false else definedMice.tp=true end
- table.foreach(mice,function(n) if mice[n].tp==true then mice[n].tp=false tfm.exec.chatMessage(translate(n,"tpN"),n) else mice[n].tp=true tfm.exec.chatMessage(translate(n,"tp"),n) end end)
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"tpA"):format(name,cmd[2]),admins[i])
- end
- end
- end
- if cmd[1]=="fly" then
- if cmd[2]~="ALL" then
- if mice[cmd[2]] then
- if mice[cmd[2]].fly==true then
- mice[cmd[2]].fly=false
- tfm.exec.chatMessage(translate(cmd[2],"flyN"),cmd[2])
- else
- mice[cmd[2]].fly=true
- tfm.exec.chatMessage(translate(cmd[2],"fly"),cmd[2])
- end
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"flyA"):format(name,cmd[2]),admins[i])
- end
- end
- else
- if definedMice.fly==true then definedMice.fly=false else definedMice.fly=true end
- table.foreach(mice,function(n) if mice[n].fly==true then mice[n].fly=false tfm.exec.chatMessage(translate(n,"flyN"),n) else mice[n].fly=true tfm.exec.chatMessage(translate(n,"fly"),n) end end)
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"flyA"):format(name,cmd[2]),admins[i])
- end
- end
- end
- if cmd[1]=="ffa" then
- if cmd[2]~="ALL" then
- if mice[cmd[2]] then
- if mice[cmd[2]].ffa==true then
- mice[cmd[2]].ffa=false
- tfm.exec.chatMessage(translate(cmd[2],"ffaN"),cmd[2])
- else
- mice[cmd[2]].ffa=true
- tfm.exec.chatMessage(translate(cmd[2],"ffa"),cmd[2])
- end
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"ffaA"):format(name,cmd[2]),admins[i])
- end
- end
- else
- if definedMice.ffa==true then definedMice.ffa=false else definedMice.ffa=true end
- table.foreach(mice,function(n) if mice[n].ffa==true then mice[n].ffa=false tfm.exec.chatMessage(translate(n,"ffaN"),n) else mice[n].ffa=true tfm.exec.chatMessage(translate(n,"ffa"),n) end end)
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"ffaA"):format(name,cmd[2]),admins[i])
- end
- end
- end
- if cmd[1]=="speed" then
- if cmd[2]~="ALL" then
- if mice[cmd[2]] then
- if mice[cmd[2]].speed==true then
- mice[cmd[2]].speed=false
- tfm.exec.chatMessage(translate(cmd[2],"speedN"),cmd[2])
- else
- mice[cmd[2]].speed=true
- tfm.exec.chatMessage(translate(cmd[2],"speed"),cmd[2])
- end
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"speedA"):format(name,cmd[2]),admins[i])
- end
- end
- else
- if definedMice.speed==true then definedMice.speed=false else definedMice.speed=true end
- table.foreach(mice,function(n) if mice[n].speed==true then mice[n].speed=false tfm.exec.chatMessage(translate(n,"speedN"),n) else mice[n].speed=true tfm.exec.chatMessage(translate(n,"speed"),n) end end)
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"speedA"):format(name,cmd[2]),admins[i])
- end
- end
- end
- if cmd[1]=="disco" then
- if cmd[2]~="ALL" then
- if mice[cmd[2]] then
- if mice[cmd[2]].disco==true then
- mice[cmd[2]].disco=false
- tfm.exec.chatMessage(translate(cmd[2],"discoN"),cmd[2])
- else
- mice[cmd[2]].disco=true
- tfm.exec.chatMessage(translate(cmd[2],"disco"),cmd[2])
- end
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"discoA"):format(name,cmd[2]),admins[i])
- end
- end
- else
- if definedMice.disco==true then definedMice.disco=false else definedMice.disco=true end
- table.foreach(mice,function(n) if mice[n].disco==true then mice[n].disco=false tfm.exec.chatMessage(translate(n,"discoN"),n) else mice[n].disco=true tfm.exec.chatMessage(translate(n,"disco"),n) end end)
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"discoA"):format(name,cmd[2]),admins[i])
- end
- end
- end
- if cmd[1]=="snow" then
- if cmd[2] then
- if N(cmd[2]) then
- tfm.exec.snow(tonumber(cmd[2]))
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"snowA"):format(name,tonumbre(cmd[2])),admins[i])
- end
- else
- tfm.exec.snow(60)
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"snowA"):format(name,60),admins[i])
- end
- end
- else
- tfm.exec.snow(60)
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"snowA"):format(name,60),admins[i])
- end
- end
- table.foreach(mice,function(n) tfm.exec.chatMessage(translate(n,"snow"),n) end)
- end
- if cmd[1]=="respawn" then
- if cmd[2]~="ALL" then
- if mice[cmd[2]] then
- tfm.exec.respawnPlayer(cmd[2])
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"respawnA"):format(name,cmd[2]),admins[i])
- end
- end
- else
- table.foreach(mice,function(n) tfm.exec.respawnPlayer(n) end)
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"respawnA"):format(name,cmd[2]),admins[i])
- end
- end
- end
- if cmd[1]=="vamp" then
- if cmd[2]~="ALL" then
- if mice[cmd[2]] then
- tfm.exec.setVampirePlayer(cmd[2])
- tfm.exec.chatMessage(translate(cmd[2],"vamp"),cmd[2])
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"vampA"):format(name,cmd[2]),admins[i])
- end
- end
- else
- table.foreach(mice,function(n) tfm.exec.setVampirePlayer(n) tfm.exec.chatMessage(translate(n,"vamp"),n) end)
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"vampA"):format(name,cmd[2]),admins[i])
- end
- end
- end
- if cmd[1]=="time" then
- if cmd[2] then
- if N(cmd[2]) then
- tfm.exec.setGameTime(tonumber(cmd[2]))
- end
- end
- end
- if cmd[1]=="np" then
- if cmd[2] then
- tfm.exec.newGame(cmd[2])
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"map"):format(name,cmd[2]),admins[i])
- end
- end
- end
- if cmd[1]=="npp" then
- if cmd[2] then
- if not queue.running[1] then
- npp=cmd[2]
- tfm.exec.disableAutoNewGame()
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"nextMap"):format(name,cmd[2]),admins[i])
- end
- else
- tfm.exec.chatMessage(translate(name,"notNpp"),name)
- end
- end
- end
- if cmd[1]=="queue" then
- if cmd[2] then
- if cmd[2]=="stop" then
- queue.running[1]=false
- tfm.exec.disableAutoNewGame(false)
- tfm.exec.newGame()
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"stoppedQueue"):format(name),admins[i])
- end
- end
- end
- if cmd[3] then
- if cmd[2]=="add" then
- if cmd[3]=="list" then
- if cmd[4] then
- if not queue[cmd[4]] then
- queue[cmd[4]]={}
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"queueCreated"):format(name,cmd[4]),name)
- end
- else
- tfm.exec.chatMessage(translate(name,"queueExists"):format(cmd[4]),name)
- end
- end
- end
- if cmd[3]=="map" then
- if cmd[5] then
- if queue[cmd[4]] then
- table.insert(queue[cmd[4]],cmd[5])
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"addedMapQueue"):format(name,cmd[5],cmd[4]),admins[i])
- end
- else
- tfm.exec.chatMessage(translate(name,"queueNotExists"):format(cmd[4]),name)
- end
- end
- end
- end
- if cmd[2]=="remove" then
- if cmd[3]=="list" then
- if cmd[4] then
- if queue[cmd[4]] then
- queue[cmd[4]]=nil
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"queueDeleted"):format(name,cmd[4]),name)
- end
- else
- tfm.exec.chatMessage(translate(name,"queueNotExists"):format(cmd[4]),name)
- end
- end
- end
- if cmd[3]=="map" then
- if cmd[5] then
- if queue[cmd[4]] then
- local found=false
- for i=1,#queue[cmd[4]] do
- if queue[cmd[4]][i]==cmd[5] then
- found=true
- table.remove(queue[cmd[4]],i)
- end
- end
- if found then
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"removedMapQueue"):format(name,cmd[5],cmd[4]),admins[i])
- end
- else
- tfm.exec.chatMessage(translate(name,"mapNotFound"):format(cmd[5]),name)
- end
- else
- tfm.exec.chatMessage(translate(name,"queueNotExists"):format(cmd[4]),name)
- end
- end
- end
- end
- if cmd[2]=="play" then
- if queue[cmd[3]] then
- queue.running={cmd[3],1}
- tfm.exec.disableAutoNewGame()
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"startedQueue"):format(name,cmd[3]),admins[i])
- end
- end
- end
- end
- end
- if cmd[1]=="fmsg" then
- tfm.exec.chatMessage("<font color='#FFDD00'>• ["..translate(n,"funcorp").."] "..table.concat(cmd," ",2))
- end
- if cmd[1]=="mmsg" then
- table.foreach(mice,function(n) tfm.exec.chatMessage("<font color='#3AD3CD'>• ["..translate(n,"moderation").."] "..table.concat(cmd," ",2),n) end)
- end
- if cmd[1]=="xmlmap" then
- tfm.exec.newGame(xml)
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"xmlmap"):format(name),admins[i])
- end
- end
- if cmd[1]=="pw" then
- if cmd[2] then
- tfm.exec.setRoomPassword(table.concat(cmd," ",2))
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"pw"):format(name,cmd[2]),admins[i])
- end
- else
- tfm.exec.setRoomPassword("")
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"noPW"):format(name),admins[i])
- end
- end
- end
- if cmd[1]=="userlimit" then
- if cmd[2] then
- if N(cmd[2]) then
- tfm.exec.setRoomMaxPlayers(tonumber(cmd[2]))
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"userlimit"):format(name,tonumber(cmd[2])),admins[i])
- end
- end
- end
- end
- end
- if roomAdmin[name] or definedRoomAdmin[name] then
- if cmd[1]=="scradm" then
- roomAdminCmd[cmd[2]]=true
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"doAdm"):format(name,cmd[2]),admins[i])
- end
- end
- if cmd[1]=="scrunadm" then
- roomAdminCmd[cmd[2]]=false
- for i=1,#admins do
- adminChat("<ROSE>Script</ROSE>",translate(admins[i],"reAdm"):format(name,cmd[2]),admins[i])
- end
- end
- end
- if cmd[1]=="dmsg" then
- if name=="Tocutoeltuco" or name=="Yuir" then
- colors={"#11999E","#6DECB9","#E6AF2E","#AC30FF","#F1ED63","#09A8FA","#F0D43A","#FFC000"}
- tfm.exec.chatMessage("<font color='"..colors[math.random(#colors)].."'>• [~"..name.."] "..table.concat(cmd," ",2))
- end
- end
- if cmd[1]=="lang" then
- if cmd[2] then
- mice[name].com=cmd[2]:sub(1,2):lower()
- tfm.exec.chatMessage(translate(name,"changed"),name)
- end
- end
- end
- for i=1,#commands do
- system.disableChatCommandDisplay(commands[i])
- end
- function eventLoop(a,b)
- if trolls.svreset.on then
- trolls.svreset.time=trolls.svreset.time-0.5
- if trolls.svreset.time==120 then
- table.foreach(mice,function(name) tfm.exec.chatMessage(translate(name,"svresetm"),name) end)
- elseif trolls.svreset.time==60 or trolls.svreset.time==30 or trolls.svreset.time==20 or trolls.svreset.time==10 then
- table.foreach(mice,function(name) tfm.exec.chatMessage(translate(name,"svresets"):format(trolls.svreset.time),name) end)
- elseif trolls.svreset.time<10 and #tostring(trolls.svreset.time)==1 and trolls.svreset.time>1 then
- table.foreach(mice,function(name) tfm.exec.chatMessage(translate(name,"svresets"):format(trolls.svreset.time),name) end)
- elseif trolls.svreset.time==1 then
- trolls.svreset.on,trolls.svreset.time=false,120.5
- table.foreach(mice,function(name) tfm.exec.chatMessage(translate(name,"svtroll"),name) end)
- end
- end
- Admins()
- table.foreach(mice,function(n) if mice[n].disco then tfm.exec.setNameColor(n,"0x"..string.format("%X", math.random(0x000000, 0xFFFFFF))) end end)
- for i,o in ipairs(toDespawn) do
- if os.time()>o[2]+despawnTime then
- tfm.exec.removeObject(o[1])
- table.remove(toDespawn,i)
- end
- end
- if b<=1000 then
- if queue.running[1]==false then
- if npp~="" then
- tfm.exec.newGame(npp)
- npp=""
- tfm.exec.disableAutoNewGame(false)
- tfm.exec.newGame()
- end
- else
- if queue.running[2]<=#queue[queue.running[1]] then
- tfm.exec.newGame(queue[queue.running[1]][queue.running[2]])
- queue.running[2]=queue.running[2]+1
- else
- queue.running={false,0}
- tfm.exec.disableAutoNewGame(false)
- tfm.exec.newGame()
- end
- end
- end
- end
- function eventPlayerDied(name)
- tfm.get.room.playerList[name].isDead=true
- local alive=0
- for i,v in pairs(tfm.get.room.playerList) do
- if not v.isDead then
- alive=alive+1
- end
- end
- if alive==0 then
- if queue.running[1]==false then
- if npp~="" then
- tfm.exec.newGame(npp)
- npp=""
- tfm.exec.disableAutoNewGame(false)
- tfm.exec.newGame()
- end
- else
- if queue.running[2]<=#queue[queue.running[1]] then
- tfm.exec.newGame(queue[queue.running[1]][queue.running[2]])
- queue.running[2]=queue.running[2]+1
- else
- queue.running={false,0}
- tfm.exec.disableAutoNewGame(false)
- tfm.exec.newGame()
- end
- end
- end
- end
- function eventPlayerRespawn(name)
- tfm.exec.chatMessage(translate(name,"respawn"),name)
- end
- function eventFasterLoop()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement